annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/AbstractUIProvider.java @ 8856:5e38e2924c07 3.2.x

Fix code style.
author Tom Gottfried <tom@intevation.de>
date Thu, 18 Jan 2018 20:12:01 +0100
parents 175df4c01ae7
children 28df64078f27
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;
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
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import com.google.gwt.core.client.GWT;
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 3384
diff changeset
12
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
13 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
14 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
15 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
16 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
17 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
18 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
19 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
20
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
21 import org.dive4elements.river.client.client.FLYSConstants;
6232
175df4c01ae7 Use WikiLink class for Help links
Andre Heinecke <aheinecke@intevation.de>
parents: 5993
diff changeset
22 import org.dive4elements.river.client.client.FLYS;
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
23 import org.dive4elements.river.client.client.event.HasStepBackHandlers;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
24 import org.dive4elements.river.client.client.event.HasStepForwardHandlers;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
25 import org.dive4elements.river.client.client.event.StepBackEvent;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
26 import org.dive4elements.river.client.client.event.StepBackHandler;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
27 import org.dive4elements.river.client.client.event.StepForwardEvent;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
28 import org.dive4elements.river.client.client.event.StepForwardHandler;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
29 import org.dive4elements.river.client.shared.model.Artifact;
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.Collection;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
32 import org.dive4elements.river.client.shared.model.Data;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
33 import org.dive4elements.river.client.shared.model.DataItem;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
34 import org.dive4elements.river.client.shared.model.DataList;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
35 import org.dive4elements.river.client.shared.model.DefaultData;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
36 import org.dive4elements.river.client.shared.model.DefaultDataItem;
1591
8ab010967f78 Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1586
diff changeset
37
3384
a6b7f0585761 Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents: 2500
diff changeset
38 import java.util.ArrayList;
a6b7f0585761 Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents: 2500
diff changeset
39 import java.util.List;
a6b7f0585761 Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents: 2500
diff changeset
40
1591
8ab010967f78 Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1586
diff changeset
41
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
42 /**
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 * 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
44 *
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 * @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
46 */
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
47 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
48 implements UIProvider, HasStepForwardHandlers, ClickHandler,
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
49 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
50 {
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 3384
diff changeset
51 private static final long serialVersionUID = -1610874613377494184L;
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 3384
diff changeset
52
5189
60b5fca4f357 Doc Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4131
diff changeset
53 /** 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
54 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
55
5189
60b5fca4f357 Doc Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4131
diff changeset
56 /** The StepForwardHandlers. */
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
57 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
58
5189
60b5fca4f357 Doc Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4131
diff changeset
59 /** The StepForwardHandlers. */
60
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
60 protected List<StepBackHandler> backHandlers;
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
61
5189
60b5fca4f357 Doc Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4131
diff changeset
62 /** 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
63 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
64
5189
60b5fca4f357 Doc Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4131
diff changeset
65 /** The artifact that contains status information. */
233
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
66 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
67
5189
60b5fca4f357 Doc Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4131
diff changeset
68 /** The Collection. */
909
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 873
diff changeset
69 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
70
5189
60b5fca4f357 Doc Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4131
diff changeset
71 /** The ParameterList. */
915
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 909
diff changeset
72 protected ParameterList parameterList;
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 909
diff changeset
73
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
74 /**
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
75 * 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
76 */
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77 public 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
78 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
79 backHandlers = new ArrayList<StepBackHandler>();
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
80 }
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
81
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
82
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
83 /**
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
84 * 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
85 *
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
86 * @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
87 */
3384
a6b7f0585761 Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents: 2500
diff changeset
88 @Override
60
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
89 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
90 if (handler != null) {
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
91 backHandlers.add(handler);
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
92 }
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
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
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
95
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
96 /**
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
97 * 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
98 *
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
99 * @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
100 */
3384
a6b7f0585761 Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents: 2500
diff changeset
101 @Override
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
102 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
103 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
104 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
105 }
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
106 }
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
107
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
108
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 /**
60
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
110 * 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
111 * 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
112 *
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
113 * @param e The StepBackEvent.
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
114 */
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
115 protected void fireStepBackEvent(StepBackEvent e) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 6232
diff changeset
116 GWT.log("AbstractUIProvider - fireStepBackEvent() handlers: "
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 6232
diff changeset
117 + backHandlers.size());
60
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
118 for (StepBackHandler handler: backHandlers) {
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
119 handler.onStepBack(e);
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
120 }
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
121 }
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
122
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
123
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
124 /**
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
125 * 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
126 * 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
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 * @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
129 */
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
130 protected void fireStepForwardEvent(StepForwardEvent e) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 6232
diff changeset
131 GWT.log("AbstractUIProvider - fireStepForwardEvent() handlers: "
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 6232
diff changeset
132 + forwardHandlers.size());
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
133 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
134 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
135 }
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
136 }
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
137
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
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
139 /**
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
140 * 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
141 * 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
142 *
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
143 * @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
144 */
3384
a6b7f0585761 Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents: 2500
diff changeset
145 @Override
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
146 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
147 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
148 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
149 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
150 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
151 }
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
152 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
153 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
154 }
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 873
diff changeset
155 }
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
156
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
157
909
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 873
diff changeset
158 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
159 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
160
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 873
diff changeset
161 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
162 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
163 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
164 }
909
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 873
diff changeset
165
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 873
diff changeset
166 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
167 }
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
168
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
169
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
170 /**
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 * 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
172 *
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
173 * @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
174 */
57
246af33f621c Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
175 protected Canvas getNextButton() {
81
1d0fb625248d Replaced next button image with smart gwt button.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 60
diff changeset
176 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
177 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
178
81
1d0fb625248d Replaced next button image with smart gwt button.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 60
diff changeset
179 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
180 }
246af33f621c Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
181
246af33f621c Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
182
2500
69a498896c9c Create a link to an online help page and put it in front of the input panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1591
diff changeset
183 @Override
6232
175df4c01ae7 Use WikiLink class for Help links
Andre Heinecke <aheinecke@intevation.de>
parents: 5993
diff changeset
184 public Canvas createHelpLink(DataList dataList, Data data, FLYS instance) {
2500
69a498896c9c Create a link to an online help page and put it in front of the input panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1591
diff changeset
185 String iUrl = GWT.getHostPageBaseURL() + MSG.getFeatureInfo();
69a498896c9c Create a link to an online help page and put it in front of the input panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1591
diff changeset
186 String helpUrl = dataList.getHelpText();
69a498896c9c Create a link to an online help page and put it in front of the input panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1591
diff changeset
187
6232
175df4c01ae7 Use WikiLink class for Help links
Andre Heinecke <aheinecke@intevation.de>
parents: 5993
diff changeset
188 return new WikiImgLink(iUrl, helpUrl, 30, 30, instance);
2500
69a498896c9c Create a link to an online help page and put it in front of the input panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1591
diff changeset
189 }
69a498896c9c Create a link to an online help page and put it in front of the input panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1591
diff changeset
190
69a498896c9c Create a link to an online help page and put it in front of the input panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1591
diff changeset
191
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
192 /**
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
193 * 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
194 *
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
195 * @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
196 *
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
197 * @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
198 */
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
199 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
200 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
201 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
202
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
203 back.addClickHandler(new ClickHandler() {
3384
a6b7f0585761 Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents: 2500
diff changeset
204 @Override
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
205 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
206 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
207 }
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
208 });
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
209
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
210 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
211 }
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
212
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
213
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
214 /**
83
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
215 * 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
216 *
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
217 * @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
218 * widgets.
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
219 */
3384
a6b7f0585761 Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents: 2500
diff changeset
220 @Override
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
221 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
222 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
223 }
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
224
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
225
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
226 /**
233
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
227 * 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
228 *
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
229 * @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
230 */
3384
a6b7f0585761 Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents: 2500
diff changeset
231 @Override
233
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
232 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
233 this.artifact = art;
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
234 }
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
235
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
236
3384
a6b7f0585761 Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents: 2500
diff changeset
237 @Override
909
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 873
diff changeset
238 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
239 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
240 }
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 873
diff changeset
241
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 873
diff changeset
242
3384
a6b7f0585761 Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents: 2500
diff changeset
243 @Override
915
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 909
diff changeset
244 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
245 this.parameterList = list;
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 909
diff changeset
246 }
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 909
diff changeset
247
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 909
diff changeset
248
909
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 873
diff changeset
249 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
250 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
251 }
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 873
diff changeset
252
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 873
diff changeset
253
233
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
254 /**
247
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
255 * 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
256 * returns it.
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
257 *
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
258 * @param items A list of Data.
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
259 * @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
260 *
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
261 * @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
262 */
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
263 protected Data getData(List<Data> data, String name) {
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
264 for (Data d: data) {
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
265 if (name.equals(d.getLabel())) {
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
266 return d;
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
267 }
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
268 }
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
269
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
270 return null;
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
873
77a549772aa9 Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
273
77a549772aa9 Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
274 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
275 ArtifactDescription desc = artifact.getArtifactDescription();
77a549772aa9 Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
276
77a549772aa9 Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
277 DataList[] old = desc.getOldData();
77a549772aa9 Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
278
77a549772aa9 Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
279 for (DataList list: old) {
5308
7712dacc27ab Avoid NPE if data list is null.
Raimund Renkert <rrenkert@intevation.de>
parents: 5189
diff changeset
280 if (list == null) {
7712dacc27ab Avoid NPE if data list is null.
Raimund Renkert <rrenkert@intevation.de>
parents: 5189
diff changeset
281 continue;
7712dacc27ab Avoid NPE if data list is null.
Raimund Renkert <rrenkert@intevation.de>
parents: 5189
diff changeset
282 }
873
77a549772aa9 Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
283 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
284
77a549772aa9 Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
285 if (d != null) {
77a549772aa9 Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
286 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
287 }
77a549772aa9 Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
288 }
77a549772aa9 Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
289
77a549772aa9 Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
290 return null;
77a549772aa9 Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
291 }
77a549772aa9 Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
292
247
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
293 /**
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
294 * 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
295 * returns it.
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
296 *
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
297 * @param items A list of DataItems.
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
298 * @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
299 *
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
300 * @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
301 */
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
302 protected DataItem getDataItem(DataItem[] items, String name) {
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
303 for (DataItem item: items) {
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
304 if (name.equals(item.getLabel())) {
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
305 return item;
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
306 }
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
307 }
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
308
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
309 return null;
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
310 }
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
311
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
312
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
313 public List<String> validate() {
5658
995320711d80 Temporary remove classification from floodmap plane theme editor (#801).
Christian Lins <christian.lins@intevation.de>
parents: 5308
diff changeset
314 return new ArrayList<String>(); // FIXME: What's this?
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
315 }
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
316
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
317
1591
8ab010967f78 Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1586
diff changeset
318 /** Create simple DefaultData with single DataItem inside. */
8ab010967f78 Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1586
diff changeset
319 public static DefaultData createDataArray(String name, String value) {
8ab010967f78 Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1586
diff changeset
320 DataItem item = new DefaultDataItem(
8ab010967f78 Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1586
diff changeset
321 name,
8ab010967f78 Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1586
diff changeset
322 name,
8ab010967f78 Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1586
diff changeset
323 value);
8ab010967f78 Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1586
diff changeset
324
8ab010967f78 Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1586
diff changeset
325 return new DefaultData(name,
8ab010967f78 Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1586
diff changeset
326 null,
8ab010967f78 Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1586
diff changeset
327 null,
8ab010967f78 Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1586
diff changeset
328 new DataItem[] {item});
8ab010967f78 Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1586
diff changeset
329 }
8ab010967f78 Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1586
diff changeset
330
8ab010967f78 Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1586
diff changeset
331
247
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
332 /**
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
333 * 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
334 * 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
335 *
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
336 * @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
337 *
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
338 * @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
339 */
3384
a6b7f0585761 Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents: 2500
diff changeset
340 @Override
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
341 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
342
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
343
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
344 /**
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
345 * 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
346 * 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
347 *
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
348 * @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
349 */
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
350 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
351 }
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
352 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org