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

Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui. Also using now the localization info from the server instead of localizing the modules again on the client side.
author gernotbelger
date Wed, 07 Feb 2018 11:59:13 +0100
parents 28df64078f27
children 8c3e5682cb60
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;
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
38
7142386e86c2 Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
11 import com.google.gwt.core.client.GWT;
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
12 import com.google.gwt.user.client.rpc.AsyncCallback;
38
7142386e86c2 Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
13
7934
71a2e408adca Moved info stack section to top level widget (parameterlist).
Raimund Renkert <rrenkert@intevation.de>
parents: 7762
diff changeset
14 import com.smartgwt.client.types.Overflow;
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 import com.smartgwt.client.types.VerticalAlignment;
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: 785
diff changeset
16 import com.smartgwt.client.types.VisibilityMode;
215
e02f50a3ad59 Improved the exception handling of artifact / collection specific operations. Warning dialog are displayed after such an exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 211
diff changeset
17 import com.smartgwt.client.util.SC;
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
18 import com.smartgwt.client.widgets.Canvas;
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 import com.smartgwt.client.widgets.layout.HLayout;
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: 785
diff changeset
20 import com.smartgwt.client.widgets.layout.SectionStack;
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: 785
diff changeset
21 import com.smartgwt.client.widgets.layout.SectionStackSection;
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 import com.smartgwt.client.widgets.layout.VLayout;
90
f8c240f28c2a The title of the parameter tab will change after the module has been selectd.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 83
diff changeset
23 import com.smartgwt.client.widgets.tab.Tab;
915
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 909
diff changeset
24 import com.smartgwt.client.widgets.tab.events.TabSelectedHandler;
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
26 import org.dive4elements.river.client.client.Config;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
27 import org.dive4elements.river.client.client.FLYS;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
28 import org.dive4elements.river.client.client.FLYSConstants;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
29 import org.dive4elements.river.client.client.event.AdvanceHandler;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
30 import org.dive4elements.river.client.client.event.CollectionChangeEvent;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
31 import org.dive4elements.river.client.client.event.CollectionChangeHandler;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
32 import org.dive4elements.river.client.client.event.HasParameterChangeHandler;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
33 import org.dive4elements.river.client.client.event.HasStepBackHandlers;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
34 import org.dive4elements.river.client.client.event.HasStepForwardHandlers;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
35 import org.dive4elements.river.client.client.event.OutputModesChangeEvent;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
36 import org.dive4elements.river.client.client.event.OutputModesChangeHandler;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
37 import org.dive4elements.river.client.client.event.ParameterChangeEvent;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
38 import org.dive4elements.river.client.client.event.ParameterChangeHandler;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
39 import org.dive4elements.river.client.client.event.StepBackEvent;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
40 import org.dive4elements.river.client.client.event.StepBackHandler;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
41 import org.dive4elements.river.client.client.event.StepForwardEvent;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
42 import org.dive4elements.river.client.client.event.StepForwardHandler;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
43 import org.dive4elements.river.client.client.services.AdvanceService;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
44 import org.dive4elements.river.client.client.services.AdvanceServiceAsync;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
45 import org.dive4elements.river.client.client.services.ArtifactService;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
46 import org.dive4elements.river.client.client.services.ArtifactServiceAsync;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
47 import org.dive4elements.river.client.client.services.ReportService;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
48 import org.dive4elements.river.client.client.services.ReportServiceAsync;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
49 import org.dive4elements.river.client.client.services.StepForwardService;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
50 import org.dive4elements.river.client.client.services.StepForwardServiceAsync;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
51 import org.dive4elements.river.client.client.ui.stationinfo.GaugePanel;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
52 import org.dive4elements.river.client.client.ui.stationinfo.InfoPanel;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
53 import org.dive4elements.river.client.client.ui.stationinfo.MeasurementStationPanel;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
54 import org.dive4elements.river.client.shared.model.Artifact;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
55 import org.dive4elements.river.client.shared.model.ArtifactDescription;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
56 import org.dive4elements.river.client.shared.model.Collection;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
57 import org.dive4elements.river.client.shared.model.Data;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
58 import org.dive4elements.river.client.shared.model.DataItem;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
59 import org.dive4elements.river.client.shared.model.DataList;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
60 import org.dive4elements.river.client.shared.model.DefaultData;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
61 import org.dive4elements.river.client.shared.model.DefaultDataItem;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
62 import org.dive4elements.river.client.shared.model.ExportMode;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
63 import org.dive4elements.river.client.shared.model.FixAnalysisArtifact;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
64 import org.dive4elements.river.client.shared.model.MINFOArtifact;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
65 import org.dive4elements.river.client.shared.model.OutputMode;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
66 import org.dive4elements.river.client.shared.model.ReportMode;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
67 import org.dive4elements.river.client.shared.model.River;
8854
7bbfb24e6eec SINFO - first prototype of BArt Fließtiefen
gernotbelger
parents: 7982
diff changeset
68 import org.dive4elements.river.client.shared.model.SINFOArtifact;
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
69 import org.dive4elements.river.client.shared.model.WINFOArtifact;
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
70
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
71 import java.util.ArrayList;
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
72 import java.util.List;
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
73 import java.util.Map;
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
74 import java.util.Set;
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
75 import java.util.TreeMap;
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77
60
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 57
diff changeset
78 public class ParameterList
90
f8c240f28c2a The title of the parameter tab will change after the module has been selectd.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 83
diff changeset
79 extends Tab
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
80 implements StepBackHandler, StepForwardHandler, ParameterChangeHandler,
513
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
81 HasParameterChangeHandler, CollectionChangeHandler,
785
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
82 OutputModesChangeHandler, AdvanceHandler
60
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 57
diff changeset
83 {
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4062
diff changeset
84 private static final long serialVersionUID = 5204784727239299980L;
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4062
diff changeset
85
789
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
86 public static final String STYLENAME_OLD_PARAMETERS = "oldParameters";
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
87
6579
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6232
diff changeset
88 /** 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: 103
diff changeset
89 protected FLYSConstants MSG = GWT.create(FLYSConstants.class);
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
90
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
91 /** The ArtifactService used to communicate with the Artifact server. */
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
92 protected ArtifactServiceAsync artifactService =
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
93 GWT.create(ArtifactService.class);
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
94
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
95 /** The StepForwardService used to put data into an existing artifact. */
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
96 protected StepForwardServiceAsync forwardService =
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
97 GWT.create(StepForwardService.class);
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
98
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
99 /** The StepForwardService used to put data into an existing artifact. */
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
100 protected AdvanceServiceAsync advanceService =
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
101 GWT.create(AdvanceService.class);
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
102
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
103
604
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
104 protected ReportServiceAsync reportService =
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
105 GWT.create(ReportService.class);
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
106
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
107
6579
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6232
diff changeset
108 /** The list of ParameterizationChangeHandler. */
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
109 protected List<ParameterChangeHandler> parameterHandlers;
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
110
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
111 protected FLYS flys;
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
112
60
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 57
diff changeset
113 protected CollectionView cView;
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
114
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
115 protected Artifact artifact;
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
116
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: 50
diff changeset
117 protected List<DataList> old;
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
118 protected Map<String, Canvas> oldStorage;
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: 50
diff changeset
119 protected DataList current;
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
120
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
121 protected UIProvider uiProvider;
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
122
256
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 233
diff changeset
123 protected VLayout topLayout;
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
124 protected VLayout oldItems;
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
125 protected VLayout currentItems;
275
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
126 protected VLayout exportModes;
582
78907f0fb939 Added dummy report panel.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 572
diff changeset
127 protected VLayout report;
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: 785
diff changeset
128 protected VLayout helperPanel;
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: 785
diff changeset
129 protected VLayout tablePanel;
4270
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
130 protected InfoPanel infoPanel;
582
78907f0fb939 Added dummy report panel.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 572
diff changeset
131 protected Canvas reportPanel;
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
132
4254
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
133 private SectionStack stack;
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
134
90
f8c240f28c2a The title of the parameter tab will change after the module has been selectd.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 83
diff changeset
135 public ParameterList(FLYS flys, CollectionView cView, String title) {
f8c240f28c2a The title of the parameter tab will change after the module has been selectd.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 83
diff changeset
136 super(title);
f8c240f28c2a The title of the parameter tab will change after the module has been selectd.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 83
diff changeset
137
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
138 this.cView = cView;
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
139 this.flys = flys;
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
140
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
141 parameterHandlers = new ArrayList<ParameterChangeHandler>();
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
142 old = new ArrayList<DataList>();
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
143 oldStorage = new TreeMap<String, Canvas>();
256
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 233
diff changeset
144 topLayout = new VLayout();
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
145 oldItems = new VLayout();
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
146 currentItems = new VLayout();
275
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
147 exportModes = new VLayout();
582
78907f0fb939 Added dummy report panel.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 572
diff changeset
148 report = new VLayout();
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
149
224
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
150 addParameterChangeHandler(this);
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
151
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
152 init();
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
153 }
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
154
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
155
224
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
156 public ParameterList(
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
157 FLYS flys,
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
158 CollectionView cView,
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
159 String title,
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
160 Artifact artifact)
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
161 {
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
162 super(title);
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
163
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
164 this.cView = cView;
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
165 this.flys = flys;
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
166 this.artifact = artifact;
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
167
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
168 parameterHandlers = new ArrayList<ParameterChangeHandler>();
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
169 old = new ArrayList<DataList>();
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
170 oldStorage = new TreeMap<String, Canvas>();
256
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 233
diff changeset
171 topLayout = new VLayout();
224
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
172 oldItems = new VLayout();
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
173 currentItems = new VLayout();
275
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
174 exportModes = new VLayout();
582
78907f0fb939 Added dummy report panel.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 572
diff changeset
175 report = new VLayout();
224
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
176
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
177 init();
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
178
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
179 addParameterChangeHandler(this);
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
180
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
181 setArtifact(artifact, false);
224
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
182 }
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
183
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
184
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
185 protected void init() {
90
f8c240f28c2a The title of the parameter tab will change after the module has been selectd.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 83
diff changeset
186 HLayout rootLayout = new HLayout();
f8c240f28c2a The title of the parameter tab will change after the module has been selectd.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 83
diff changeset
187 rootLayout.setMembersMargin(20);
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
188
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
189 VLayout left = new VLayout();
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
190
83
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
191 if (old == null || old.size() == 0) {
572
830e4720caad Avoid GWT throwing warnings if no 'old' items exist for the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 513
diff changeset
192 oldItems.setHeight(1);
83
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
193 }
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
194
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
195 oldItems.setMembersMargin(10);
789
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
196 oldItems.setStyleName(STYLENAME_OLD_PARAMETERS);
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
197 currentItems.setAlign(VerticalAlignment.TOP);
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
198
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
199 left.setMembersMargin(20);
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
200 left.setWidth(300);
50
827eb4e06ebf Added space between old params panel and new params panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 40
diff changeset
201
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
202 left.addMember(oldItems);
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
203 left.addMember(currentItems);
275
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
204 left.addMember(exportModes);
582
78907f0fb939 Added dummy report panel.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 572
diff changeset
205 left.addMember(report);
78907f0fb939 Added dummy report panel.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 572
diff changeset
206
78907f0fb939 Added dummy report panel.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 572
diff changeset
207 reportPanel = new Canvas();
78907f0fb939 Added dummy report panel.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 572
diff changeset
208 reportPanel.setHeight("*");
78907f0fb939 Added dummy report panel.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 572
diff changeset
209 report.addMember(reportPanel);
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
210
90
f8c240f28c2a The title of the parameter tab will change after the module has been selectd.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 83
diff changeset
211 rootLayout.addMember(left);
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: 785
diff changeset
212 rootLayout.addMember(createSectionStack());
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
213
256
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 233
diff changeset
214 topLayout.addMember(rootLayout);
224
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
215 if (artifact == null) {
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
216 Canvas moduleSelection = renderNew();
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
217 moduleSelection.setLayoutAlign(VerticalAlignment.TOP);
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
218 currentItems.addMember(moduleSelection);
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
219 }
90
f8c240f28c2a The title of the parameter tab will change after the module has been selectd.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 83
diff changeset
220
256
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 233
diff changeset
221 setPane(topLayout);
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
222 }
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
223
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
224
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: 785
diff changeset
225 protected SectionStack createSectionStack() {
4254
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
226 stack = new SectionStack();
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: 785
diff changeset
227 stack.setHeight100();
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: 785
diff changeset
228 stack.setCanResizeSections(true);
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: 785
diff changeset
229 stack.setVisibilityMode(VisibilityMode.MULTIPLE);
7934
71a2e408adca Moved info stack section to top level widget (parameterlist).
Raimund Renkert <rrenkert@intevation.de>
parents: 7762
diff changeset
230 stack.setOverflow(Overflow.SCROLL);
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: 785
diff changeset
231
3346
f2039d030b5e Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2500
diff changeset
232 // This canvas is used to render 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: 785
diff changeset
233 final SectionStackSection helperSection = new SectionStackSection();
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: 785
diff changeset
234 helperSection.setExpanded(false);
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: 785
diff changeset
235 helperSection.setTitle(MSG.helperPanelTitle());
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: 785
diff changeset
236 helperPanel = new VLayout() {
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
237 @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: 785
diff changeset
238 public void addMember(Canvas component) {
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: 785
diff changeset
239 super.addMember(component);
1388
4b177fd52f06 Expand the map selection section in helper panel on project start.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 915
diff changeset
240 stack.expandSection(helperSection.getID());
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: 785
diff changeset
241 }
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: 785
diff changeset
242
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
243 @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: 785
diff changeset
244 public void removeMembers(Canvas[] components) {
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: 785
diff changeset
245 super.removeMembers(components);
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: 785
diff changeset
246 helperSection.setExpanded(false);
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: 785
diff changeset
247 }
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: 785
diff changeset
248 };
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: 785
diff changeset
249 helperPanel.setWidth100();
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: 785
diff changeset
250 helperPanel.setHeight100();
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: 785
diff changeset
251 helperSection.setItems(helperPanel);
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: 785
diff changeset
252
3346
f2039d030b5e Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2500
diff changeset
253 // This canvas is used to render calculation results.
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: 785
diff changeset
254 final SectionStackSection tableSection = new SectionStackSection();
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: 785
diff changeset
255 tableSection.setExpanded(false);
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: 785
diff changeset
256 tableSection.setTitle(MSG.calcTableTitle());
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: 785
diff changeset
257 tablePanel = new VLayout() {
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
258 @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: 785
diff changeset
259 public void addMember(Canvas component) {
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: 785
diff changeset
260 super.addMember(component);
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: 785
diff changeset
261 tableSection.setExpanded(true);
7982
b1ff606f01ee Fixed some smartgwt 4.1 related issues.
Raimund Renkert <rrenkert@intevation.de>
parents: 7934
diff changeset
262 if (stack.getSection(InfoPanel.SECTION_ID) != null) {
b1ff606f01ee Fixed some smartgwt 4.1 related issues.
Raimund Renkert <rrenkert@intevation.de>
parents: 7934
diff changeset
263 stack.getSection(InfoPanel.SECTION_ID).setExpanded(false);
b1ff606f01ee Fixed some smartgwt 4.1 related issues.
Raimund Renkert <rrenkert@intevation.de>
parents: 7934
diff changeset
264 }
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: 785
diff changeset
265 }
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: 785
diff changeset
266
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
267 @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: 785
diff changeset
268 public void removeMembers(Canvas[] components) {
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: 785
diff changeset
269 super.removeMembers(components);
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: 785
diff changeset
270 tableSection.setExpanded(false);
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: 785
diff changeset
271 }
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: 785
diff changeset
272 };
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: 785
diff changeset
273 tablePanel.setHeight100();
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: 785
diff changeset
274 tablePanel.setWidth100();
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: 785
diff changeset
275 tableSection.setItems(tablePanel);
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: 785
diff changeset
276
4254
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
277 stack.setSections(helperSection, tableSection);
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: 785
diff changeset
278
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: 785
diff changeset
279 return stack;
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: 785
diff changeset
280 }
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: 785
diff changeset
281
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: 785
diff changeset
282
3346
f2039d030b5e Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2500
diff changeset
283 /** Sets and forwards artifact. */
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
284 protected void setArtifact(Artifact artifact) {
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
285 setArtifact(artifact, true);
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
286 }
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
287
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
288
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
289 protected void setArtifact(Artifact artifact, boolean forward) {
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
290 Artifact tmp = this.artifact;
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
291 this.artifact = artifact;
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
292
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
293 if (forward) {
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
294 fireParameterChangeEvent(
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
295 tmp, this.artifact, ParameterChangeEvent.Type.FORWARD);
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
296 }
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
297 else {
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
298 fireParameterChangeEvent(
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
299 tmp, this.artifact, ParameterChangeEvent.Type.BACK);
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
300 }
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
301 }
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
302
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
303
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
304 /**
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
305 * This method registers a new ParameterChangeHandler.
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
306 *
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
307 * @param handler The new ParameterChangeHandler.
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
308 */
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
309 @Override
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
310 public void addParameterChangeHandler(ParameterChangeHandler handler) {
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
311 if (handler != null) {
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
312 parameterHandlers.add(handler);
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
313 }
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
314 }
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
315
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
316
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
317 /**
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
318 * This method calls the <code>onParameterChange()</code> method of all
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
319 * registered ParameterChangeHandler.
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
320 */
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
321 protected void fireParameterChangeEvent(
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
322 Artifact old,
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
323 Artifact newArt,
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
324 ParameterChangeEvent.Type type)
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
325 {
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
326 ParameterChangeEvent e = new ParameterChangeEvent(old, newArt, type);
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
327
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
328 for (ParameterChangeHandler handler: parameterHandlers) {
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
329 handler.onParameterChange(e);
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
330 }
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
331 }
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
332
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
333
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
334 /**
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
335 * This method creates a Canvas displaying the plugins of FLYS combined with
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
336 * a widget to select a river.
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
337 *
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
338 * @return a Canvas that displays the supported plugins and rivers of FLYS.
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
339 */
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
340 protected Canvas renderNew() {
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
341 River[] rivers = flys.getRivers();
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
342 DataItem[] items = new DataItem[rivers.length];
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
343
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
344 int i = 0;
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
345 for (River river: rivers) {
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
346 String name = river.getName();
7762
2a97d9c3413a Use the river model_uuid as value for data items.
Raimund Renkert <rrenkert@intevation.de>
parents: 6579
diff changeset
347 String mUuid = river.getModelUuid();
2a97d9c3413a Use the river model_uuid as value for data items.
Raimund Renkert <rrenkert@intevation.de>
parents: 6579
diff changeset
348 items[i++] = new DefaultDataItem(name, null, mUuid);
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
349 }
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
350
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
351 Data data = new DefaultData(
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
352 "river",
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
353 MSG.river_selection(),
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
354 null,
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
355 items);
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
356
3346
f2039d030b5e Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2500
diff changeset
357 LinkSelection widget = new LinkSelection();
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
358 HasStepForwardHandlers handler = widget;
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
359
83
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
360 widget.setContainer(helperPanel);
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
361
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
362 handler.addStepForwardHandler(new StepForwardHandler() {
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4062
diff changeset
363 private static final long serialVersionUID = -6210719844707004860L;
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4062
diff changeset
364
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
365 @Override
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
366 public void onStepForward(StepForwardEvent event) {
3353
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
367 lockUI();
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
368 Data[] data = event.getData();
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
369
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
370 DataItem[] moduleItems = data[0].getItems();
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
371 DataItem[] riversItems = data[1].getItems();
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
372
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
373 String module = moduleItems[0].getStringValue();
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
374 String river = riversItems[0].getStringValue();
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
375
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4062
diff changeset
376 if (module == null || river == null) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 7982
diff changeset
377 GWT.log("ParameterList.renderNew(): module == null "
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 7982
diff changeset
378 + "|| river == null");
3353
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
379 unlockUI();
90
f8c240f28c2a The title of the parameter tab will change after the module has been selectd.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 83
diff changeset
380 return;
f8c240f28c2a The title of the parameter tab will change after the module has been selectd.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 83
diff changeset
381 }
8870
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 8860
diff changeset
382 final String newTitle = moduleItems[0].getLabel();
102
33e24b33fc38 Improved the way how to i18n strings in our application.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 90
diff changeset
383 setTitle(newTitle);
90
f8c240f28c2a The title of the parameter tab will change after the module has been selectd.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 83
diff changeset
384
229
924da6695800 Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 224
diff changeset
385 Config config = Config.getInstance();
924da6695800 Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 224
diff changeset
386 final String locale = config.getLocale();
924da6695800 Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 224
diff changeset
387
3346
f2039d030b5e Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2500
diff changeset
388 final Data[] feedData = new Data[] { data[1] };
229
924da6695800 Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 224
diff changeset
389
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
390 artifactService.create(
1425
bc06a671ef60 Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1388
diff changeset
391 locale, module.toLowerCase(), null,
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
392 new AsyncCallback<Artifact>() {
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
393 @Override
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
394 public void onFailure(Throwable caught) {
3353
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
395 unlockUI();
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
396 GWT.log("Could not create the new artifact.");
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4062
diff changeset
397 SC.warn(FLYS.getExceptionString(MSG, caught));
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
398 }
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
399
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
400 @Override
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
401 public void onSuccess(Artifact artifact) {
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
402 GWT.log("Successfully created a new artifact.");
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
403
1425
bc06a671ef60 Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1388
diff changeset
404 forwardService.go(locale, artifact, feedData,
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
405 new AsyncCallback<Artifact>() {
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
406 @Override
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
407 public void onFailure(Throwable caught) {
3353
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
408 unlockUI();
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
409 GWT.log("Could not feed the artifact.");
215
e02f50a3ad59 Improved the exception handling of artifact / collection specific operations. Warning dialog are displayed after such an exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 211
diff changeset
410 SC.warn(caught.getMessage());
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
411 }
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
412
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
413 @Override
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
414 public void onSuccess(Artifact artifact) {
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
415 GWT.log("Successfully feed the artifact.");
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
416 old.clear();
909
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 867
diff changeset
417 cView.addArtifactToCollection(artifact);
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
418 setArtifact(artifact);
3353
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
419 unlockUI();
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
420 }
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
421 });
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
422 }
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
423 });
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
424 }
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
425 });
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
426
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
427 DataList list = new DataList();
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
428 list.add(data);
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
429
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
430 return widget.create(list);
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
431 }
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
432
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
433
38
7142386e86c2 Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
434 protected void clearOldData() {
7142386e86c2 Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
435 old.clear();
7142386e86c2 Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
436 }
7142386e86c2 Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
437
7142386e86c2 Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
438
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: 50
diff changeset
439 public void addOldData(DataList old) {
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
440 addOldData(old, true);
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
441 }
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
442
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
443
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
444 public void addOldData(DataList old, boolean redraw) {
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
445 if (old != null) {
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
446 this.old.add(old);
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
447 }
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
448
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
449 refreshOld(redraw);
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
450 }
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
451
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
452
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: 50
diff changeset
453 public void addOldDatas(DataList[] old) {
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
454 addOldDatas(old, true);
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
455 }
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
456
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
457
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
458 public void addOldDatas(DataList[] old, boolean redraw) {
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
459 if (old != null && old.length > 0) {
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: 50
diff changeset
460 for (DataList o: old) {
785
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
461 if (o == null) {
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
462 continue;
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
463 }
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
464
38
7142386e86c2 Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
465 if (!exists(o)) {
7142386e86c2 Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
466 GWT.log("Data '" + o.getLabel() + "' is new.");
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
467 addOldData(o, false);
38
7142386e86c2 Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
468 }
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
469 }
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
470
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
471 if (redraw) {
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
472 addOldData(null, true);
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
473 }
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
474
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
475 return;
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
476 }
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
477
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
478 addOldData(null, true);
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
479 }
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
480
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
481
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: 50
diff changeset
482 public boolean exists(DataList data) {
785
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
483 if (data == null) {
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
484 return false;
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
485 }
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
486
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: 50
diff changeset
487 String stateName = data.getState();
38
7142386e86c2 Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
488
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: 50
diff changeset
489 for (DataList o: old) {
a2923d63f530 Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 50
diff changeset
490 if (stateName.equals(o.getState())) {
38
7142386e86c2 Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
491 return true;
7142386e86c2 Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
492 }
7142386e86c2 Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
493 }
7142386e86c2 Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
494
7142386e86c2 Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
495 return false;
7142386e86c2 Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
496 }
7142386e86c2 Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
497
7142386e86c2 Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
498
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: 50
diff changeset
499 public void setCurrentData(DataList current, UIProvider uiProvider) {
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
500 this.current = current;
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
501 this.uiProvider = uiProvider;
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
502
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
503 refreshCurrent();
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
504 }
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
505
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
506
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
507 public void refreshOld(boolean redrawAll) {
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
508 if (redrawAll) {
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
509 refreshAllOld();
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
510 }
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
511 else {
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
512 DataList dataList = old.get(old.size()-1);
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
513 String state = dataList.getState();
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
514
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
515 if (oldStorage.get(state) == null) {
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
516 String provider = dataList.getUIProvider();
909
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 867
diff changeset
517 UIProvider uiprovider = UIProviderFactory.getProvider(
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 867
diff changeset
518 provider,
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 867
diff changeset
519 flys.getCurrentUser());
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
520 ((HasStepBackHandlers) uiprovider).addStepBackHandler(this);
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
521
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
522 Canvas c = uiprovider.createOld(dataList);
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
523 if (c != null) {
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
524 oldStorage.put(dataList.getState(), c);
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
525 oldItems.addMember(c);
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
526 }
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
527 }
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
528 }
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
529
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
530 updateOldHeight();
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
531 }
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
532
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
533
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
534 protected void refreshAllOld() {
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
535 List<String> not = new ArrayList<String>();
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
536
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
537 for (DataList data: old) {
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
538 String state = data.getState();
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
539
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
540 Canvas c = oldStorage.get(state);
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
541
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
542 if (c != null) {
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
543 not.add(state);
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
544 }
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
545 }
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
546
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
547 Map<String, Canvas> newOld = new TreeMap<String, Canvas>();
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
548
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
549 Set<Map.Entry<String, Canvas>> entries = oldStorage.entrySet();
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
550 for (Map.Entry<String, Canvas> entry: entries) {
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
551 String state = entry.getKey();
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
552 Canvas value = entry.getValue();
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
553
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
554 if (not.indexOf(state) < 0) {
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
555 oldItems.removeMember(value);
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
556 }
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
557 else {
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
558 newOld.put(state, value);
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
559 }
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
560 }
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
561
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
562 oldStorage = newOld;
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
563 }
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
564
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
565
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
566 protected void updateOldHeight() {
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
567 int minHeight = oldItems.getMinHeight();
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
568 if (minHeight <= 20) {
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
569 oldItems.setHeight(20);
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
570 }
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
571 else {
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
572 oldItems.setHeight(minHeight);
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
573 }
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
574 }
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
575
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
576
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
577 /**
6579
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6232
diff changeset
578 * Refreshes the part displaying the data of the current state.
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
579 * The UI is created using the UIProvider stored in the Data object.
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
580 */
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
581 public void refreshCurrent() {
40
1458bc0a20e2 Clear the panel that displays the current input widget before adding a new item to this panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 38
diff changeset
582 currentItems.removeMembers(currentItems.getMembers());
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
583
54
0db278371632 Remove the dynamic parameter panel if a state is reached that doesn't need any user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
584 if (current != null && uiProvider != null) {
0db278371632 Remove the dynamic parameter panel if a state is reached that doesn't need any user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
585 Canvas c = uiProvider.create(current);
6232
175df4c01ae7 Use WikiLink class for Help links
Andre Heinecke <aheinecke@intevation.de>
parents: 5993
diff changeset
586 Canvas h = uiProvider.createHelpLink(current, null, this.flys);
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: 1493
diff changeset
587
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: 1493
diff changeset
588 HLayout wrapper = new HLayout();
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: 1493
diff changeset
589 wrapper.addMember(h);
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: 1493
diff changeset
590 wrapper.addMember(c);
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: 1493
diff changeset
591
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: 1493
diff changeset
592 currentItems.addMember(wrapper);
785
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
593 }
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
594 else if (uiProvider != null) {
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
595 Canvas c = uiProvider.create(null);
54
0db278371632 Remove the dynamic parameter panel if a state is reached that doesn't need any user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
596 c.setLayoutAlign(VerticalAlignment.TOP);
0db278371632 Remove the dynamic parameter panel if a state is reached that doesn't need any user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
597
0db278371632 Remove the dynamic parameter panel if a state is reached that doesn't need any user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
598 currentItems.addMember(c);
0db278371632 Remove the dynamic parameter panel if a state is reached that doesn't need any user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
599 }
275
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
600 else {
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
601 currentItems.setHeight(1);
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
602 }
789
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
603
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
604 Canvas[] members = currentItems.getMembers();
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
605 if (members == null || members.length == 0) {
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
606 currentItems.setHeight(1);
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
607 }
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
608 else {
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
609 int height = 0;
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
610
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
611 for (Canvas member: members) {
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
612 height += member.getHeight();
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
613 }
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
614
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
615 currentItems.setHeight(height);
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
616 }
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
617 }
60
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 57
diff changeset
618
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 57
diff changeset
619
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 57
diff changeset
620 /**
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
621 * This method is called if the user clicks on the 'next' button to advance
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
622 * to the next state.
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
623 *
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
624 * @param event The StepForwardEvent.
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
625 */
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
626 @Override
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
627 public void onStepForward(StepForwardEvent event) {
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
628 GWT.log("CollectionView - onStepForward()");
3353
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
629 lockUI();
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
630
3346
f2039d030b5e Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2500
diff changeset
631 Config config = Config.getInstance();
f2039d030b5e Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2500
diff changeset
632 String locale = config.getLocale();
229
924da6695800 Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 224
diff changeset
633
1425
bc06a671ef60 Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1388
diff changeset
634 forwardService.go(locale, artifact, event.getData(),
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
635 new AsyncCallback<Artifact>() {
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
636 @Override
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
637 public void onFailure(Throwable caught) {
3353
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
638 unlockUI();
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
639 GWT.log("Could not feed the artifact.");
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
640 SC.warn(FLYS.getExceptionString(MSG, caught));
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
641 }
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
642
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
643 @Override
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
644 public void onSuccess(Artifact artifact) {
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
645 GWT.log("Successfully feed the artifact.");
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
646 old.clear();
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
647
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
648 setArtifact(artifact, true);
3353
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
649 unlockUI();
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
650 }
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
651 });
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
652 }
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
653
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
654
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
655 /**
60
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 57
diff changeset
656 * This method is used to remove all old items from this list after the user
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 57
diff changeset
657 * has clicked the step back button.
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 57
diff changeset
658 *
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
659 * @param e The StepBackEvent that holds the identifier of the target state.
60
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 57
diff changeset
660 */
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
661 @Override
60
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 57
diff changeset
662 public void onStepBack(StepBackEvent e) {
3353
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
663 lockUI();
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
664 final String target = e.getTarget();
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
665
229
924da6695800 Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 224
diff changeset
666 Config config = Config.getInstance();
924da6695800 Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 224
diff changeset
667 final String locale = config.getLocale();
924da6695800 Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 224
diff changeset
668
1425
bc06a671ef60 Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1388
diff changeset
669 advanceService.advance(locale, artifact, target,
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
670 new AsyncCallback<Artifact>() {
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
671 @Override
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
672 public void onFailure(Throwable caught) {
3353
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
673 unlockUI();
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
674 GWT.log("Could not go back to '" + target + "'");
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
675 SC.warn(FLYS.getExceptionString(MSG, caught));
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
676 }
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
677
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
678 @Override
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
679 public void onSuccess(Artifact artifact) {
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
680 GWT.log("Successfully step back to '" + target + "'");
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
681
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
682 old.clear();
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
683
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
684 setArtifact(artifact, false);
3353
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
685 unlockUI();
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
686 }
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
687 }
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
688 );
60
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 57
diff changeset
689 }
72
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
690
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
691
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
692 @Override
785
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
693 public void onAdvance(final String target) {
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
694 Config config = Config.getInstance();
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
695 final String locale = config.getLocale();
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
696
1425
bc06a671ef60 Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1388
diff changeset
697 advanceService.advance(locale, artifact, target,
785
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
698 new AsyncCallback<Artifact>() {
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
699 @Override
785
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
700 public void onFailure(Throwable caught) {
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
701 GWT.log("Could not go to '" + target + "'");
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
702 SC.warn(FLYS.getExceptionString(MSG, caught));
785
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
703 }
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
704
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
705 @Override
785
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
706 public void onSuccess(Artifact artifact) {
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
707 GWT.log("Successfully advanced to '" + target + "'");
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
708
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
709 old.clear();
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
710
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
711 setArtifact(artifact, true);
785
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
712 }
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
713 }
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
714 );
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
715 }
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
716
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
717
72
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
718 /**
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
719 * Implements the onCollectionChange() method to do update the GUI after the
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
720 * parameterization has changed.
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
721 *
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
722 * @param event The ParameterChangeEvent.
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
723 */
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
724 @Override
72
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
725 public void onParameterChange(ParameterChangeEvent event) {
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
726 GWT.log("ParameterList.onParameterChange");
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
727
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: 785
diff changeset
728 Canvas[] c = helperPanel.getMembers();
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: 785
diff changeset
729 if (c != null && c.length > 0) {
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: 785
diff changeset
730 helperPanel.removeMembers(c);
83
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
731 }
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
732
72
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
733 Artifact art = event.getNewValue();
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
734 ArtifactDescription desc = art.getArtifactDescription();
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
735
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
736 DataList currentData = desc.getCurrentData();
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
737 if (currentData != null) {
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
738 // the user has to enter some attributes
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
739 String uiProvider = currentData.getUIProvider();
909
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 867
diff changeset
740 UIProvider provider = UIProviderFactory.getProvider(
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 867
diff changeset
741 uiProvider,
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 867
diff changeset
742 flys.getCurrentUser());
72
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
743
83
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
744 provider.setContainer(helperPanel);
233
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 229
diff changeset
745 provider.setArtifact(art);
909
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 867
diff changeset
746 provider.setCollection(cView.getCollection());
915
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 909
diff changeset
747 provider.setParameterList(this);
83
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
748
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
749 ((HasStepForwardHandlers) provider).addStepForwardHandler(this);
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
750 ((HasStepBackHandlers) provider).addStepBackHandler(this);
72
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
751
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
752 setCurrentData(currentData, provider);
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
753 }
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
754 else {
785
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
755 String[] reachable = desc.getReachableStates();
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
756 if (reachable != null && reachable.length > 0) {
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
757 // We have reached a final state with the option to step to
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
758 // further to a next state. But in the current state, no user
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
759 // data is required.
867
6a2ed979dfcf Added new UIProvider "DatacageTwinPanel", pass user via UIProviderFactory.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 845
diff changeset
760 UIProvider ui = UIProviderFactory.getProvider("continue", null);
785
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
761 ui.setArtifact(art);
909
794d1af42987 Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 867
diff changeset
762 ui.setCollection(cView.getCollection());
915
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 909
diff changeset
763 ui.setParameterList(this);
785
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
764
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
765 ((ContinuePanel) ui).addAdvanceHandler(this);
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
766
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
767 setCurrentData(null, ui);
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
768 }
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
769 else {
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
770 // we have reached a final state with no more user input
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
771 setCurrentData(null, null);
3ae0facd4cab Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 604
diff changeset
772 }
72
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
773 }
8854
7bbfb24e6eec SINFO - first prototype of BArt Fließtiefen
gernotbelger
parents: 7982
diff changeset
774
7bbfb24e6eec SINFO - first prototype of BArt Fließtiefen
gernotbelger
parents: 7982
diff changeset
775 // FIXME: we got a whole artifact framework to separate ui and backend stuff, but in the end.... we have switches over specific datatypes here...
4556
5e25a2b19ddd Add GaugeOverview to Fixanalysis
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4306
diff changeset
776 if (art instanceof WINFOArtifact
8854
7bbfb24e6eec SINFO - first prototype of BArt Fließtiefen
gernotbelger
parents: 7982
diff changeset
777 || art instanceof SINFOArtifact
7bbfb24e6eec SINFO - first prototype of BArt Fließtiefen
gernotbelger
parents: 7982
diff changeset
778 || art instanceof FixAnalysisArtifact) {
4270
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
779 createGaugePanel();
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
780 renderInfo(desc.getRiver(), desc.getOldData());
3715
8d3e48f189d2 Add first draft for the gauge overview info ui
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 3353
diff changeset
781 }
4271
6c776f102e03 Show measurement info panel if MINFO artifact is choosen
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4270
diff changeset
782 else if (art instanceof MINFOArtifact) {
6c776f102e03 Show measurement info panel if MINFO artifact is choosen
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4270
diff changeset
783 createMeasurementStationPanel();
6c776f102e03 Show measurement info panel if MINFO artifact is choosen
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4270
diff changeset
784 renderInfo(desc.getRiver(), desc.getOldData());
6c776f102e03 Show measurement info panel if MINFO artifact is choosen
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4270
diff changeset
785 }
4254
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
786 else {
4270
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
787 removeInfoPanel();
4254
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
788 }
72
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
789
790
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
790 addOldDatas(
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
791 desc.getOldData(),
3fa8583434b2 Made stepping forward/backword much smoother in the parameter list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 789
diff changeset
792 event.getType() == ParameterChangeEvent.Type.BACK);
72
9b726350ab07 Moved ParameterList specific code into the ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
793 }
256
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 233
diff changeset
794
275
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
795
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
796 @Override
275
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
797 public void onCollectionChange(CollectionChangeEvent event) {
513
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
798 Collection c = event.getNewValue();
275
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
799 Map<String, OutputMode> outs = c.getOutputModes();
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
800 Set<String> keys = outs.keySet();
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
801
513
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
802 OutputMode[] outputs = new OutputMode[outs.size()];
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
803
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
804 int idx = 0;
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
805 for (String outname: keys) {
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
806 outputs[idx++] = outs.get(outname);
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
807 }
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
808
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
809 updateExportModes(c, getExportModes(outputs));
589
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
810 updateReportModes(c, getReportModes(outputs));
513
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
811 }
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
812
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
813
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
814 @Override
513
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
815 public void onOutputModesChange(OutputModesChangeEvent event) {
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
816
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
817 Collection c = cView.getCollection();
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
818
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
819 if (c != null) {
589
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
820 OutputMode [] outs = event.getOutputModes();
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
821 updateExportModes(c, getExportModes(outs));
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
822 updateReportModes(c, getReportModes(outs));
513
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
823 }
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
824 }
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
825
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
826
589
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
827 protected List<ReportMode> getReportModes(OutputMode [] outs) {
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
828
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
829 List<ReportMode> reports = new ArrayList<ReportMode>();
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
830
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
831 if (outs == null || outs.length == 0) {
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
832 return reports;
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
833 }
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
834
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
835 for (OutputMode out: outs) {
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
836 if (out instanceof ReportMode) {
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
837 reports.add((ReportMode)out);
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
838 }
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
839 }
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
840
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
841 return reports;
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
842 }
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
843
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
844
513
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
845 protected List<ExportMode> getExportModes(OutputMode[] outs) {
275
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
846 List<ExportMode> exports = new ArrayList<ExportMode>();
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
847
513
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
848 if (outs == null || outs.length == 0) {
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
849 return exports;
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
850 }
275
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
851
513
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
852 for (OutputMode out: outs) {
275
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
853 if (out instanceof ExportMode) {
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
854 exports.add((ExportMode) out);
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
855 }
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
856 }
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
857
513
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 282
diff changeset
858 return exports;
275
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
859 }
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
860
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
861
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
862 protected void updateExportModes(Collection c, List<ExportMode> exports) {
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
863 int num = exports != null ? exports.size() : 0;
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
864 GWT.log("Update export modes: " + num);
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
865
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
866 exportModes.removeMembers(exportModes.getMembers());
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
867
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
868 if (exports.size() > 0) {
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
869 exportModes.addMember(new ExportPanel(c, exports));
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
870 }
789
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
871 else {
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
872 exportModes.setHeight(1);
e8be9a188e64 Layout improvements related to the height of components in the current parameterlist.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
873 }
275
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
874 }
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
875
589
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
876 protected void updateReportModes(Collection c, List<ReportMode> reports) {
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
877 int num = reports != null ? reports.size() : 0;
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
878 GWT.log("Update report modes: " + num);
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
879
604
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
880 if (num == 0) {
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
881 reportPanel.setContents("");
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
882 return;
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
883 }
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
884
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
885 Config config = Config.getInstance();
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
886 String locale = config.getLocale();
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
887
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
888 String cid = c.identifier();
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
889
589
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
890 for (ReportMode report: reports) {
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
891 GWT.log("report '" + report.toString() + "'");
604
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
892
1425
bc06a671ef60 Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1388
diff changeset
893 reportService.report(cid, locale, report.getName(),
604
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
894 new AsyncCallback<String>() {
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
895 @Override
604
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
896 public void onFailure(Throwable caught) {
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
897 SC.warn(FLYS.getExceptionString(MSG, caught));
604
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
898 }
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
899
4062
145980c21700 Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents: 3974
diff changeset
900 @Override
604
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
901 public void onSuccess(String msg) {
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
902 setReportMessage(msg);
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
903 }
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
904 });
589
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
905 }
604
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
906 }
589
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
907
4617
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4556
diff changeset
908
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4556
diff changeset
909 /** Sets content of reportPanel. */
604
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
910 protected void setReportMessage(String msg) {
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
911 GWT.log("returned from service: " + msg);
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
912 if (msg == null) {
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
913 msg = "";
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
914 }
84d3c5fde5bb First version of error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 589
diff changeset
915 reportPanel.setContents(msg);
589
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
916 }
942bd0e7e332 Filter reports and dispatch them to updateReports().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 582
diff changeset
917
275
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 271
diff changeset
918
256
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 233
diff changeset
919 /**
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 233
diff changeset
920 * Adds a table to the parameterlist to show calculated data.
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 233
diff changeset
921 *
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 233
diff changeset
922 * @param table The table data panel.
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 233
diff changeset
923 */
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: 785
diff changeset
924 public void setTable(TableDataPanel table) {
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: 785
diff changeset
925 removeTable();
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: 785
diff changeset
926
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: 785
diff changeset
927 Canvas c = table.create();
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: 785
diff changeset
928 c.setHeight100();
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: 785
diff changeset
929 c.setWidth100();
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: 785
diff changeset
930
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: 785
diff changeset
931 tablePanel.addMember(c);
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: 785
diff changeset
932 }
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: 785
diff changeset
933
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: 785
diff changeset
934
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: 785
diff changeset
935 public boolean hasTable() {
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: 785
diff changeset
936 Canvas[] members = tablePanel.getMembers();
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: 785
diff changeset
937
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: 785
diff changeset
938 return members != null && members.length > 0;
260
dd1dad2ff94e Remove the data table on step back.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
939 }
dd1dad2ff94e Remove the data table on step back.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
940
dd1dad2ff94e Remove the data table on step back.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
941
dd1dad2ff94e Remove the data table on step back.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
942 /**
dd1dad2ff94e Remove the data table on step back.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
943 * Removes the table from the parameter list.
dd1dad2ff94e Remove the data table on step back.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
944 */
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: 785
diff changeset
945 public void removeTable() {
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: 785
diff changeset
946 Canvas[] members = tablePanel.getMembers();
260
dd1dad2ff94e Remove the data table on step back.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
947
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: 785
diff changeset
948 if (members != null && members.length > 0) {
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: 785
diff changeset
949 tablePanel.removeMembers(members);
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: 785
diff changeset
950 }
256
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 233
diff changeset
951 }
915
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 909
diff changeset
952
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 909
diff changeset
953
4662
9220ab02f34f Codeformat++
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4617
diff changeset
954 public void registerCollectionViewTabHandler(TabSelectedHandler tsh) {
9220ab02f34f Codeformat++
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4617
diff changeset
955 this.cView.registerTabHandler(tsh);
915
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 909
diff changeset
956 }
3353
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
957
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
958
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
959 protected void lockUI() {
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
960 cView.lockUI();
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
961 }
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
962
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
963
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
964 protected void unlockUI() {
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
965 cView.unlockUI();
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3346
diff changeset
966 }
3715
8d3e48f189d2 Add first draft for the gauge overview info ui
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 3353
diff changeset
967
8d3e48f189d2 Add first draft for the gauge overview info ui
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 3353
diff changeset
968
4254
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
969 private void createGaugePanel() {
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
970 GWT.log("ParameterList - createGaugePanel");
4270
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
971 if (infoPanel == null) {
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
972 infoPanel = new GaugePanel(flys);
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
973 infoPanel.setWidth100();
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
974 infoPanel.setHeight100();
4254
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
975 }
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
976 }
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
977
4271
6c776f102e03 Show measurement info panel if MINFO artifact is choosen
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4270
diff changeset
978 private void createMeasurementStationPanel() {
6c776f102e03 Show measurement info panel if MINFO artifact is choosen
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4270
diff changeset
979 GWT.log("ParameterList - createMeasurementStationPanel");
6c776f102e03 Show measurement info panel if MINFO artifact is choosen
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4270
diff changeset
980 if (infoPanel == null) {
6c776f102e03 Show measurement info panel if MINFO artifact is choosen
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4270
diff changeset
981 infoPanel = new MeasurementStationPanel(flys);
6c776f102e03 Show measurement info panel if MINFO artifact is choosen
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4270
diff changeset
982 infoPanel.setWidth100();
6c776f102e03 Show measurement info panel if MINFO artifact is choosen
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4270
diff changeset
983 infoPanel.setHeight100();
6c776f102e03 Show measurement info panel if MINFO artifact is choosen
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4270
diff changeset
984 }
6c776f102e03 Show measurement info panel if MINFO artifact is choosen
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4270
diff changeset
985 }
6c776f102e03 Show measurement info panel if MINFO artifact is choosen
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4270
diff changeset
986
4270
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
987 private void showInfoPanel() {
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
988 GWT.log("ParameterList - showInfoPanel");
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
989
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
990 /* Don't add InfoPanel twice */
7934
71a2e408adca Moved info stack section to top level widget (parameterlist).
Raimund Renkert <rrenkert@intevation.de>
parents: 7762
diff changeset
991 SectionStackSection info = stack.getSection(InfoPanel.SECTION_ID);
71a2e408adca Moved info stack section to top level widget (parameterlist).
Raimund Renkert <rrenkert@intevation.de>
parents: 7762
diff changeset
992 if (info == null) {
71a2e408adca Moved info stack section to top level widget (parameterlist).
Raimund Renkert <rrenkert@intevation.de>
parents: 7762
diff changeset
993 info = new SectionStackSection();
71a2e408adca Moved info stack section to top level widget (parameterlist).
Raimund Renkert <rrenkert@intevation.de>
parents: 7762
diff changeset
994 info.setTitle(infoPanel.getSectionTitle());
71a2e408adca Moved info stack section to top level widget (parameterlist).
Raimund Renkert <rrenkert@intevation.de>
parents: 7762
diff changeset
995 info.setID(InfoPanel.SECTION_ID);
71a2e408adca Moved info stack section to top level widget (parameterlist).
Raimund Renkert <rrenkert@intevation.de>
parents: 7762
diff changeset
996 info.setName(InfoPanel.SECTION_ID);
71a2e408adca Moved info stack section to top level widget (parameterlist).
Raimund Renkert <rrenkert@intevation.de>
parents: 7762
diff changeset
997 info.setItems(infoPanel);
71a2e408adca Moved info stack section to top level widget (parameterlist).
Raimund Renkert <rrenkert@intevation.de>
parents: 7762
diff changeset
998 stack.addSection(info, 0);
4270
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
999 }
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
1000
7934
71a2e408adca Moved info stack section to top level widget (parameterlist).
Raimund Renkert <rrenkert@intevation.de>
parents: 7762
diff changeset
1001 info.setExpanded(true);
4254
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
1002 }
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
1003
4270
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
1004 private void hideInfoPanel() {
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
1005 GWT.log("ParameterList - hideInfoPanel");
4254
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
1006
4270
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
1007 if (infoPanel != null) {
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
1008 infoPanel.hide();
4254
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
1009 }
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
1010 }
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
1011
4270
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
1012 private void removeInfoPanel() {
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
1013 GWT.log("ParameterList - removeInfoPanel");
4292
250c4a0fa696 Remove InfoPanel stack only if it exists
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4271
diff changeset
1014 SectionStackSection exists = stack.getSection(InfoPanel.SECTION_ID);
250c4a0fa696 Remove InfoPanel stack only if it exists
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4271
diff changeset
1015 if (exists != null) {
250c4a0fa696 Remove InfoPanel stack only if it exists
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4271
diff changeset
1016 stack.removeSection(InfoPanel.SECTION_ID);
250c4a0fa696 Remove InfoPanel stack only if it exists
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4271
diff changeset
1017 }
4254
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
1018 }
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
1019
33b15ac17fd1 Only create and add GaugePanel when necessary
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4229
diff changeset
1020
4270
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
1021 private void renderInfo(String river, DataList[] data) {
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
1022 GWT.log("ParameterList - renderInfo");
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
1023
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
1024 if (river != null) {
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
1025 showInfoPanel();
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
1026 infoPanel.setRiver(river);
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
1027 infoPanel.setData(data);
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
1028 }
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
1029 else {
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
1030 GWT.log("ParameterList - renderInfo no river");
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
1031 hideInfoPanel();
cde9a6fe1844 Refactor ParameterList to use new InfoPanel base class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4254
diff changeset
1032 }
3715
8d3e48f189d2 Add first draft for the gauge overview info ui
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 3353
diff changeset
1033 }
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1034 }
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1035 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org