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