Mercurial > dive4elements > river
annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/MultipleLocationPanel.java @ 8297:6f866709bbff
Official sedimentload epochs should be seperated from other data in datacage.
author | "Tom Gottfried <tom@intevation.de>" |
---|---|
date | Fri, 19 Sep 2014 09:49:09 +0200 |
parents | ea9eef426962 |
children | 5e38e2924c07 |
rev | line source |
---|---|
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
9 package org.dive4elements.river.client.client.ui; |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
10 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
11 import com.google.gwt.core.client.GWT; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
12 import com.google.gwt.i18n.client.NumberFormat; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
13 |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
3539
diff
changeset
|
14 import com.smartgwt.client.data.Record; |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
15 import com.smartgwt.client.util.SC; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
16 import com.smartgwt.client.widgets.Canvas; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
17 import com.smartgwt.client.widgets.Label; |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
3539
diff
changeset
|
18 import com.smartgwt.client.widgets.form.fields.events.BlurEvent; |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
19 import com.smartgwt.client.widgets.form.fields.events.BlurHandler; |
4221
480de0dbca8e
Extended location input helper.
Raimund Renkert <rrenkert@intevation.de>
parents:
4184
diff
changeset
|
20 import com.smartgwt.client.widgets.grid.events.CellClickEvent; |
480de0dbca8e
Extended location input helper.
Raimund Renkert <rrenkert@intevation.de>
parents:
4184
diff
changeset
|
21 import com.smartgwt.client.widgets.grid.events.CellClickHandler; |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
22 import com.smartgwt.client.widgets.layout.HLayout; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
23 import com.smartgwt.client.widgets.layout.VLayout; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
24 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
25 import org.dive4elements.river.client.client.Config; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
26 import org.dive4elements.river.client.client.services.DistanceInfoService; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
27 import org.dive4elements.river.client.client.services.DistanceInfoServiceAsync; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
28 import org.dive4elements.river.client.client.ui.range.DistanceInfoDataSource; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
29 import org.dive4elements.river.client.shared.DoubleUtils; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
30 import org.dive4elements.river.client.shared.model.ArtifactDescription; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
31 import org.dive4elements.river.client.shared.model.Data; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
32 import org.dive4elements.river.client.shared.model.DataItem; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
33 import org.dive4elements.river.client.shared.model.DataList; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
34 import org.dive4elements.river.client.shared.model.DistanceInfoObject; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
35 import org.dive4elements.river.client.shared.model.RangeData; |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
36 |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
3539
diff
changeset
|
37 import java.util.ArrayList; |
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
3539
diff
changeset
|
38 import java.util.List; |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
39 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
40 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
41 /** |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
42 * This UIProvider creates a widget to enter a single location (km). |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
43 * |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
44 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
45 */ |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
46 public class MultipleLocationPanel |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
47 extends LocationPanel |
4221
480de0dbca8e
Extended location input helper.
Raimund Renkert <rrenkert@intevation.de>
parents:
4184
diff
changeset
|
48 implements CellClickHandler |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
49 { |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
3539
diff
changeset
|
50 private static final long serialVersionUID = -3359966826794082718L; |
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
3539
diff
changeset
|
51 |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
52 /** The DistanceInfoService used to retrieve locations about rivers. */ |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
53 protected DistanceInfoServiceAsync distanceInfoService = |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
54 GWT.create(DistanceInfoService.class); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
55 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
56 /** The table data. */ |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
57 protected DistanceInfoObject[] tableData; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
58 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
59 /** The input helper (usually right side, table to click on, values are |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
60 * then entered in the texfield. */ |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
61 protected LocationPicker picker; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
62 |
1615
07c38d054f91
Translate data item in locationpanel label.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1612
diff
changeset
|
63 |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
64 /** |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
65 * Creates a new LocationDistancePanel instance. |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
66 */ |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
67 public MultipleLocationPanel() { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
68 picker = new LocationPicker(this); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
69 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
70 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
71 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
72 /** |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
73 * This method creates a widget that contains a label, a panel with |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
74 * checkboxes to switch the input mode between location and distance input, |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
75 * and a mode specific panel. |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
76 * |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
77 * @param data The data that might be inserted. |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
78 * |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
79 * @return a panel. |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
80 */ |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
81 @Override |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
82 public Canvas create(DataList data) { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
83 findDataItemName(data); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
84 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
85 VLayout layout = new VLayout(); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
86 layout.setMembersMargin(10); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
87 |
1615
07c38d054f91
Translate data item in locationpanel label.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1612
diff
changeset
|
88 // Take translated data item name as label, if translation available. |
07c38d054f91
Translate data item in locationpanel label.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1612
diff
changeset
|
89 String labelString; |
07c38d054f91
Translate data item in locationpanel label.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1612
diff
changeset
|
90 try { |
07c38d054f91
Translate data item in locationpanel label.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1612
diff
changeset
|
91 labelString = MSG.getString(getDataItemName()); |
07c38d054f91
Translate data item in locationpanel label.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1612
diff
changeset
|
92 } |
07c38d054f91
Translate data item in locationpanel label.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1612
diff
changeset
|
93 catch(java.util.MissingResourceException mre) { |
07c38d054f91
Translate data item in locationpanel label.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1612
diff
changeset
|
94 GWT.log("Cannot find translation for data item name : " + getDataItemName()); |
3493
e703555f8da1
Issue 752.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2905
diff
changeset
|
95 labelString = getLabelString(); |
1615
07c38d054f91
Translate data item in locationpanel label.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1612
diff
changeset
|
96 } |
07c38d054f91
Translate data item in locationpanel label.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1612
diff
changeset
|
97 Label label = new Label(labelString); |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
98 Canvas widget = createWidget(data); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
99 Canvas submit = getNextButton(); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
100 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
101 initDefaults(data); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
102 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
103 picker.createLocationTable(); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
104 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
105 widget.setHeight(50); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
106 label.setHeight(25); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
107 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
108 layout.addMember(label); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
109 layout.addMember(widget); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
110 layout.addMember(submit); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
111 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
112 return layout; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
113 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
114 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
115 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
116 /** |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
117 * This method reads the default values defined in the DataItems of the Data |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
118 * objects in <i>list</i>. |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
119 * |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
120 * @param list The DataList container that stores the Data objects. |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
121 */ |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
3539
diff
changeset
|
122 @Override |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
123 protected void initDefaults(DataList list) { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
124 Data data = list.get(0); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
125 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
126 // Compatibility with MinMax- DataItems: |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
127 RangeData rangeData = null; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
128 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
129 for (int i = 0, n = list.size(); i < n; i++) { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
130 Data tmp = list.get(i); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
131 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
132 if (tmp instanceof RangeData) { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
133 rangeData = (RangeData) tmp; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
134 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
135 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
136 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
137 if (rangeData != null) { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
138 min = Double.parseDouble(rangeData.getDefaultLower().toString()); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
139 max = Double.parseDouble(rangeData.getDefaultUpper().toString()); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
140 // catch ..? |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
141 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
142 else { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
143 DataItem[] items = data.getItems(); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
144 DataItem iMin = getDataItem(items, "min"); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
145 DataItem iMax = getDataItem(items, "max"); |
2905
51ed89b754ae
FLYS client: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2898
diff
changeset
|
146 |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
147 try { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
148 min = Double.parseDouble(iMin.getStringValue()); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
149 max = Double.parseDouble(iMax.getStringValue()); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
150 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
151 catch (NumberFormatException nfe) { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
152 SC.warn(MSG.error_read_minmax_values()); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
153 min = -Double.MAX_VALUE; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
154 max = Double.MAX_VALUE; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
155 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
156 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
157 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
158 DataItem def = data.getDefault(); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
159 if (def != null) { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
160 String value = def.getStringValue(); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
161 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
162 try { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
163 double d = Double.parseDouble(value); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
164 setLocationValues(new double[] { d } ); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
165 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
166 catch (NumberFormatException nfe) { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
167 // could not parse, dont know what to do else |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
168 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
169 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
170 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
171 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
172 |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
3539
diff
changeset
|
173 @Override |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
174 protected Canvas createWidget(DataList data) { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
175 VLayout layout = new VLayout(); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
176 inputLayout = new HLayout(); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
177 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
178 // The initial view will display the location input mode. |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
179 locationPanel = new DoubleArrayPanel( |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
180 MSG.unitLocation(), |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
181 getLocationValues(), |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
3539
diff
changeset
|
182 new BlurHandler(){@Override |
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
3539
diff
changeset
|
183 public void onBlur(BlurEvent be) {validate();}}); |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
184 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
185 picker.getLocationTable().setAutoFetchData(true); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
186 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
187 inputLayout.addMember(locationPanel); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
188 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
189 layout.addMember(inputLayout); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
190 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
191 inputLayout.setMembersMargin(30); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
192 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
193 picker.prepareFilter(); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
194 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
195 helperContainer.addMember(picker.getLocationTable()); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
196 helperContainer.addMember(picker.getFilterLayout()); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
197 helperContainer.addMember(picker.getResultCountForm()); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
198 setPickerDataSource(); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
199 return layout; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
200 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
201 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
202 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
203 /** Overridden to restrict to one entered value. */ |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
204 @Override |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
205 public List<String> validate() { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
206 List<String> errors = new ArrayList<String>(); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
207 NumberFormat nf = NumberFormat.getDecimalFormat(); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
208 |
3539
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
209 DataList[] ref = artifact.getArtifactDescription().getOldData(); |
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
210 String mode = ref[1].get(0).getStringValue(); |
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
211 |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
212 saveLocationValues(locationPanel); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
213 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
214 if (!locationPanel.validateForm()) { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
215 errors.add(MSG.wrongFormat()); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
216 return errors; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
217 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
218 |
1618
95b821d63db3
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1617
diff
changeset
|
219 double[] lValues = getLocationValues(); |
95b821d63db3
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1617
diff
changeset
|
220 double[] good = new double[lValues.length]; |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
221 int idx = 0; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
222 |
3539
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
223 double reference = |
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
224 Double.valueOf(ref[2].get(0).getStringValue()).doubleValue(); |
1618
95b821d63db3
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1617
diff
changeset
|
225 for (double value: lValues) { |
3539
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
226 if (mode.equals("calc.reference.curve") && |
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
227 value == reference) { |
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
228 errors.add(MSG.error_contains_same_location()); |
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
229 return errors; |
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
230 } |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
231 if (value < min || value > max) { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
232 String tmp = MSG.error_validate_range(); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
233 tmp = tmp.replace("$1", nf.format(value)); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
234 tmp = tmp.replace("$2", nf.format(min)); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
235 tmp = tmp.replace("$3", nf.format(max)); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
236 errors.add(tmp); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
237 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
238 else { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
239 good[idx++] = value; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
240 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
241 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
242 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
243 double[] justGood = new double[idx]; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
244 for (int i = 0; i < justGood.length; i++) { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
245 justGood[i] = good[i]; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
246 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
247 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
248 if (!errors.isEmpty()) { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
249 locationPanel.setValues(justGood); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
250 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
251 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
252 return errors; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
253 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
254 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
255 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
256 /** |
1615
07c38d054f91
Translate data item in locationpanel label.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1612
diff
changeset
|
257 * This method returns the selected data (to feed). |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
258 * |
1615
07c38d054f91
Translate data item in locationpanel label.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1612
diff
changeset
|
259 * @return the selected/inserted data in feedable form. |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
260 */ |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
3539
diff
changeset
|
261 @Override |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
262 public Data[] getData() { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
263 saveLocationValues(locationPanel); |
1618
95b821d63db3
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1617
diff
changeset
|
264 double[] lValues = getLocationValues(); |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
265 Data[] data = new Data[2]; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
266 boolean first = true; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
267 String valueString = ""; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
268 |
1618
95b821d63db3
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1617
diff
changeset
|
269 for (int i = 0; i < lValues.length; i++) { |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
270 if (!first) valueString += " "; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
271 else first = false; |
1618
95b821d63db3
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1617
diff
changeset
|
272 valueString += Double.valueOf(lValues[i]).toString(); |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
273 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
274 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
275 data[0] = createDataArray(getDataItemName(), valueString); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
276 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
277 data[1] = createDataArray("ld_mode", "locations"); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
278 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
279 return data; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
280 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
281 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
282 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
283 /** Hook service to the listgrid with possible input values. */ |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
284 protected void setPickerDataSource() { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
285 Config config = Config.getInstance(); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
286 String url = config.getServerUrl(); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
287 String river = ""; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
288 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
289 ArtifactDescription adescr = artifact.getArtifactDescription(); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
290 DataList[] data = adescr.getOldData(); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
291 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
292 // Try to find a "river" data item to set the source for the |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
293 // list grid. |
2898
242b5c230707
Added UI for S-Q-relation parameters in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1618
diff
changeset
|
294 String dataFilter = "locations"; |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
295 if (data != null && data.length > 0) { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
296 for (int i = 0; i < data.length; i++) { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
297 DataList dl = data[i]; |
2898
242b5c230707
Added UI for S-Q-relation parameters in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1618
diff
changeset
|
298 if (dl.getState().equals("state.minfo.river")) { |
242b5c230707
Added UI for S-Q-relation parameters in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1618
diff
changeset
|
299 dataFilter = "measuringpoint"; |
242b5c230707
Added UI for S-Q-relation parameters in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1618
diff
changeset
|
300 } |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
301 if (dl.getState().equals("state.winfo.river") || |
2898
242b5c230707
Added UI for S-Q-relation parameters in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1618
diff
changeset
|
302 dl.getState().equals("state.chart.river") || |
242b5c230707
Added UI for S-Q-relation parameters in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1618
diff
changeset
|
303 dl.getState().equals("state.minfo.river")) { |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
304 for (int j = 0; j < dl.size(); j++) { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
305 Data d = dl.get(j); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
306 DataItem[] di = d.getItems(); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
307 if (di != null && di.length == 1) { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
308 river = d.getItems()[0].getStringValue(); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
309 break; |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
310 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
311 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
312 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
313 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
314 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
315 |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
316 picker.getLocationTable().setDataSource(new DistanceInfoDataSource( |
2898
242b5c230707
Added UI for S-Q-relation parameters in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1618
diff
changeset
|
317 url, river, dataFilter)); |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
318 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
319 |
1615
07c38d054f91
Translate data item in locationpanel label.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1612
diff
changeset
|
320 |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
321 // TODO allow multiple selections here or in LocationPanel |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
322 /** |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
323 * Callback when an item from the input helper was clicked. |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
324 * Set the respective km-value in the location value field. |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
325 * @param e event passed. |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
326 */ |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
3539
diff
changeset
|
327 @Override |
4221
480de0dbca8e
Extended location input helper.
Raimund Renkert <rrenkert@intevation.de>
parents:
4184
diff
changeset
|
328 public void onCellClick (CellClickEvent e) { |
1617
f13a7c126f24
Allow selection of multiple locations with mouse in MultipleLocationPanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1615
diff
changeset
|
329 Record record = e.getRecord(); |
f13a7c126f24
Allow selection of multiple locations with mouse in MultipleLocationPanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1615
diff
changeset
|
330 double[] old = getLocationValues(); |
f13a7c126f24
Allow selection of multiple locations with mouse in MultipleLocationPanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1615
diff
changeset
|
331 double[] selected = DoubleUtils.copyOf(old, old.length + 1); |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
332 try { |
1617
f13a7c126f24
Allow selection of multiple locations with mouse in MultipleLocationPanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1615
diff
changeset
|
333 selected[old.length] = |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
334 Double.parseDouble(record.getAttribute("from")); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
335 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
336 catch(NumberFormatException nfe) { |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
337 // Is there anything else to do here? |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
3539
diff
changeset
|
338 GWT.log(nfe.getMessage()); |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
339 } |
3539
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
340 |
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
341 // compare reference location and target location. |
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
342 DataList[] ref = artifact.getArtifactDescription().getOldData(); |
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
343 String mode = ref[1].get(0).getStringValue(); |
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
344 if (mode.equals("calc.reference.curve") && |
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
345 ref[2].get(0).getStringValue().equals(record.getAttribute("from"))) |
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
346 { |
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
347 SC.warn(MSG.error_same_location()); |
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
348 return; |
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
349 } |
091397efaca5
Issue 791: Do not allow the same values in reference and target location.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3493
diff
changeset
|
350 |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
351 setLocationValues(selected); |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
352 } |
3493
e703555f8da1
Issue 752.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2905
diff
changeset
|
353 |
4980
e70ff0a600a3
flys-client: Whitespace and doc cosemtics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4221
diff
changeset
|
354 |
3493
e703555f8da1
Issue 752.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2905
diff
changeset
|
355 /** |
e703555f8da1
Issue 752.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2905
diff
changeset
|
356 * Returns the label string for the input panel. |
e703555f8da1
Issue 752.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2905
diff
changeset
|
357 */ |
e703555f8da1
Issue 752.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2905
diff
changeset
|
358 protected String getLabelString() { |
e703555f8da1
Issue 752.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2905
diff
changeset
|
359 return MSG.location(); |
e703555f8da1
Issue 752.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2905
diff
changeset
|
360 } |
1612
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
361 } |
66671b69c7ea
Added new UIProvider to enter mutliple locations (yet only input view textfield possible).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
362 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |