Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java @ 1519:a6f6c61b18be
Implemented synchronous navigation through cross section profiles.
flys-client/trunk@3672 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 13 Jan 2012 10:07:09 +0000 |
parents | 89a47098bcbd |
children | dbdf954dbe94 |
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 |
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
|
3 import java.util.ArrayList; |
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
|
4 import java.util.List; |
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
|
5 |
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 import com.google.gwt.core.client.GWT; |
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 |
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:
247
diff
changeset
|
8 import com.smartgwt.client.util.SC; |
788
dfbc6693247e
Integrated a stacked panel on the right side of the ParameterList that enables users to see calculation results and the helper panel at the same time.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
562
diff
changeset
|
9 import com.smartgwt.client.widgets.Button; |
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
|
10 import com.smartgwt.client.widgets.Canvas; |
57
246af33f621c
Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
11 import com.smartgwt.client.widgets.Img; |
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
|
12 import com.smartgwt.client.widgets.events.ClickEvent; |
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.events.ClickHandler; |
788
dfbc6693247e
Integrated a stacked panel on the right side of the ParameterList that enables users to see calculation results and the helper panel at the same time.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
562
diff
changeset
|
14 import com.smartgwt.client.widgets.layout.VLayout; |
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
|
15 |
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:
89
diff
changeset
|
16 import de.intevation.flys.client.client.FLYSConstants; |
60
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
17 import de.intevation.flys.client.client.event.HasStepBackHandlers; |
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
|
18 import de.intevation.flys.client.client.event.HasStepForwardHandlers; |
60
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
19 import de.intevation.flys.client.client.event.StepBackEvent; |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
20 import de.intevation.flys.client.client.event.StepBackHandler; |
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
|
21 import de.intevation.flys.client.client.event.StepForwardEvent; |
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
|
22 import de.intevation.flys.client.client.event.StepForwardHandler; |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
23 import de.intevation.flys.client.shared.model.Artifact; |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
24 import de.intevation.flys.client.shared.model.ArtifactDescription; |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
25 import de.intevation.flys.client.shared.model.Collection; |
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
|
26 import de.intevation.flys.client.shared.model.Data; |
247
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
27 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:
41
diff
changeset
|
28 import de.intevation.flys.client.shared.model.DataList; |
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
|
29 |
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
|
30 /** |
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
|
31 * An abstract UIProvider that provides some basic methods. |
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
|
32 * |
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
|
33 * @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
|
34 */ |
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
|
35 public abstract class AbstractUIProvider |
60
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
36 implements UIProvider, HasStepForwardHandlers, ClickHandler, |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
37 HasStepBackHandlers |
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
|
38 { |
57
246af33f621c
Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
39 /** 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:
89
diff
changeset
|
40 protected FLYSConstants MSG = GWT.create(FLYSConstants.class); |
57
246af33f621c
Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
41 |
246af33f621c
Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
42 |
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
|
43 /** The StepForwardHandlers.*/ |
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
|
44 protected List<StepForwardHandler> forwardHandlers; |
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
|
45 |
60
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
46 /** The StepForwardHandlers.*/ |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
47 protected List<StepBackHandler> backHandlers; |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
48 |
83
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
81
diff
changeset
|
49 /** The container that is used to position helper widgets.*/ |
788
dfbc6693247e
Integrated a stacked panel on the right side of the ParameterList that enables users to see calculation results and the helper panel at the same time.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
562
diff
changeset
|
50 protected VLayout helperContainer; |
83
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
81
diff
changeset
|
51 |
233
137daff2c732
Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
52 /** The artifact that contains status information.*/ |
137daff2c732
Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
53 protected Artifact artifact; |
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
|
54 |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
55 /** The Collection.*/ |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
56 protected Collection collection; |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
57 |
915
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
909
diff
changeset
|
58 /** The ParameterList.*/ |
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
909
diff
changeset
|
59 protected ParameterList parameterList; |
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
909
diff
changeset
|
60 |
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
|
61 /** |
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
|
62 * Creates a new UIProvider instance of this class. |
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 */ |
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
|
64 public AbstractUIProvider() { |
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
|
65 forwardHandlers = new ArrayList<StepForwardHandler>(); |
60
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
66 backHandlers = new ArrayList<StepBackHandler>(); |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
67 } |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
68 |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
69 |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
70 /** |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
71 * Appends a StepBackHandler that wants to listen to StepBackEvents. |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
72 * |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
73 * @param handler A new StepBackHandler. |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
74 */ |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
75 public void addStepBackHandler(StepBackHandler handler) { |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
76 if (handler != null) { |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
77 backHandlers.add(handler); |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
78 } |
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
|
79 } |
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 |
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 |
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
|
82 /** |
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
|
83 * Appends a StepForwardHandler that wants to listen to StepForwardEvents. |
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
|
84 * |
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
|
85 * @param handler A new StepForwardHandler. |
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
|
86 */ |
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
|
87 public void addStepForwardHandler(StepForwardHandler handler) { |
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 if (handler != 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
|
89 forwardHandlers.add(handler); |
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 } |
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 } |
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
|
92 |
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
|
93 |
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 /** |
60
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
95 * This method is called after the user has clicked one of the buttons to |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
96 * step back to a previous state. |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
97 * |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
98 * @param e The StepBackEvent. |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
99 */ |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
100 protected void fireStepBackEvent(StepBackEvent e) { |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
101 GWT.log("AbstractUIProvider - fireStepBackEvent() handlers: " + backHandlers.size()); |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
102 for (StepBackHandler handler: backHandlers) { |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
103 handler.onStepBack(e); |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
104 } |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
105 } |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
106 |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
107 |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
108 /** |
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
|
109 * This method is called after the user has clicked on the 'next' button 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
|
110 * step to the next state. |
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
|
111 * |
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
|
112 * @param e The StepForwardEvent. |
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
|
113 */ |
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
|
114 protected void fireStepForwardEvent(StepForwardEvent e) { |
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
|
115 GWT.log("AbstractUIProvider - fireStepForwardEvent() handlers: " + forwardHandlers.size()); |
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
|
116 for (StepForwardHandler handler: forwardHandlers) { |
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
|
117 handler.onStepForward(e); |
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
|
118 } |
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
|
119 } |
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
|
120 |
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
|
121 |
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
|
122 /** |
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
|
123 * This method is used to listen to click events on the 'next' button. The |
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
|
124 * fireStepForwardEvent() method is called here. |
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
|
125 * |
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
|
126 * @param e The click 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
|
127 */ |
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
|
128 public void onClick(ClickEvent e) { |
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:
247
diff
changeset
|
129 List<String> errors = 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:
247
diff
changeset
|
130 if (errors == null || 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:
247
diff
changeset
|
131 Data[] data = getData(); |
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:
247
diff
changeset
|
132 fireStepForwardEvent(new StepForwardEvent(data)); |
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:
247
diff
changeset
|
133 } |
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:
247
diff
changeset
|
134 else { |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
135 showErrors(errors); |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
136 } |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
137 } |
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
|
138 |
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:
247
diff
changeset
|
139 |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
140 protected void showErrors(List<String> errors) { |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
141 StringBuilder sb = new StringBuilder(); |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
142 |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
143 for (String error: errors) { |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
144 sb.append(error); |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
145 sb.append("<br>"); |
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:
247
diff
changeset
|
146 } |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
147 |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
148 SC.warn(sb.toString()); |
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
|
149 } |
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
|
150 |
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
|
151 |
58
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
152 /** |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
153 * Creates the 'next' button to step forward to the next state. |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
154 * |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
155 * @return the 'next' button. |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
156 */ |
57
246af33f621c
Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
157 protected Canvas getNextButton() { |
81
1d0fb625248d
Replaced next button image with smart gwt button.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
60
diff
changeset
|
158 Button next = new Button(MSG.buttonNext()); |
1d0fb625248d
Replaced next button image with smart gwt button.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
60
diff
changeset
|
159 next.addClickHandler(this); |
57
246af33f621c
Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
160 |
81
1d0fb625248d
Replaced next button image with smart gwt button.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
60
diff
changeset
|
161 return next; |
57
246af33f621c
Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
162 } |
246af33f621c
Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
163 |
246af33f621c
Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
164 |
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
|
165 /** |
58
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
166 * Creates the 'back' button to step back to a previous state. |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
167 * |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
168 * @param targetState The identifier of the target state. |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
169 * |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
170 * @return the 'back' button. |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
171 */ |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
172 protected Canvas getBackButton(final String targetState) { |
89
131e3f23a74e
Modified the URL of the 'back button' image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
83
diff
changeset
|
173 String url = GWT.getHostPageBaseURL() + MSG.imageBack(); |
131e3f23a74e
Modified the URL of the 'back button' image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
83
diff
changeset
|
174 Img back = new Img(url, 16, 16); |
58
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
175 |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
176 back.addClickHandler(new ClickHandler() { |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
177 public void onClick(ClickEvent event) { |
60
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
178 fireStepBackEvent(new StepBackEvent(targetState)); |
58
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
179 } |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
180 }); |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
181 |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
182 return back; |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
183 } |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
184 |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
185 |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
186 /** |
83
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
81
diff
changeset
|
187 * This method injects a container that is used to position helper widgets. |
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
81
diff
changeset
|
188 * |
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
81
diff
changeset
|
189 * @param helperContainer A container that is used to position helper |
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
81
diff
changeset
|
190 * widgets. |
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
81
diff
changeset
|
191 */ |
788
dfbc6693247e
Integrated a stacked panel on the right side of the ParameterList that enables users to see calculation results and the helper panel at the same time.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
562
diff
changeset
|
192 public void setContainer(VLayout helperContainer) { |
83
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
81
diff
changeset
|
193 this.helperContainer = helperContainer; |
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
81
diff
changeset
|
194 } |
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
81
diff
changeset
|
195 |
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
81
diff
changeset
|
196 |
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
81
diff
changeset
|
197 /** |
233
137daff2c732
Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
198 * This method injects an artifact that contains the status information. |
137daff2c732
Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
199 * |
137daff2c732
Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
200 * @param art An artifact containing status information. |
137daff2c732
Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
201 */ |
137daff2c732
Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
202 public void setArtifact(Artifact art) { |
137daff2c732
Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
203 this.artifact = art; |
137daff2c732
Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
204 } |
137daff2c732
Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
205 |
137daff2c732
Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
206 |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
207 public void setCollection(Collection collection) { |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
208 this.collection = collection; |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
209 } |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
210 |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
211 |
915
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
909
diff
changeset
|
212 public void setParameterList(ParameterList list) { |
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
909
diff
changeset
|
213 this.parameterList = list; |
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
909
diff
changeset
|
214 } |
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
909
diff
changeset
|
215 |
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
909
diff
changeset
|
216 |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
217 public Collection getCollection() { |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
218 return collection; |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
219 } |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
220 |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
221 |
233
137daff2c732
Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
222 /** |
247
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
223 * This method greps the Data with name <i>name</i> from the list and |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
224 * returns it. |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
225 * |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
226 * @param items A list of Data. |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
227 * @param name The name of the Data that we are searching for. |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
228 * |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
229 * @return the Data with the name <i>name</i>. |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
230 */ |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
231 protected Data getData(List<Data> data, String name) { |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
232 for (Data d: data) { |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
233 if (name.equals(d.getLabel())) { |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
234 return d; |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
235 } |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
236 } |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
237 |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
238 return null; |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
239 } |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
240 |
873
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
241 |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
242 protected String getDataValue(String state, String name) { |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
243 ArtifactDescription desc = artifact.getArtifactDescription(); |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
244 |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
245 DataList[] old = desc.getOldData(); |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
246 |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
247 for (DataList list: old) { |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
248 Data d = getData(list.getAll(), name); |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
249 |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
250 if (d != null) { |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
251 return d.getItems()[0].getStringValue(); |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
252 } |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
253 } |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
254 |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
255 return null; |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
256 } |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
257 |
247
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
258 /** |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
259 * This method greps the DataItem with name <i>name</i> from the list and |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
260 * returns it. |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
261 * |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
262 * @param items A list of DataItems. |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
263 * @param name The name of the DataItem that we are searching for. |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
264 * |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
265 * @return the DataItem with the name <i>name</i>. |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
266 */ |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
267 protected DataItem getDataItem(DataItem[] items, String name) { |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
268 for (DataItem item: items) { |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
269 if (name.equals(item.getLabel())) { |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
270 return item; |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
271 } |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
272 } |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
273 |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
274 return null; |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
275 } |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
276 |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
277 |
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:
247
diff
changeset
|
278 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:
247
diff
changeset
|
279 return 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:
247
diff
changeset
|
280 } |
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:
247
diff
changeset
|
281 |
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:
247
diff
changeset
|
282 |
247
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
283 /** |
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
|
284 * This method needs to be implemented by concrete subclasses. It should |
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
|
285 * create a new Canvas object with a representation of <i>data</i>. |
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
|
286 * |
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
|
287 * @param data The data that should be displayed. |
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
|
288 * |
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
|
289 * @return a Canvas object that displays <i>data</i>. |
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
|
290 */ |
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:
41
diff
changeset
|
291 public abstract 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
|
292 |
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
|
293 |
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
|
294 /** |
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
|
295 * This method needs to be implemented by concrete subclasses. It should |
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
|
296 * return 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
|
297 * |
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
|
298 * @return 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
|
299 */ |
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
|
300 protected abstract Data[] getData(); |
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
|
301 } |
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
|
302 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |