Mercurial > dive4elements > river
annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/CollectionView.java @ 9561:5397555d74c9
MapOutputTab fix
author | gernotbelger |
---|---|
date | Thu, 25 Oct 2018 17:00:58 +0200 |
parents | c81cf7e2a770 |
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:
5871
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:
5871
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; |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
11 import java.util.ArrayList; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
12 import java.util.HashMap; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
13 import java.util.List; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
14 import java.util.Map; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
15 import java.util.Set; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
16 import java.util.Stack; |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
18 import org.dive4elements.river.client.client.Config; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
19 import org.dive4elements.river.client.client.FLYS; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
20 import org.dive4elements.river.client.client.FLYSConstants; |
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.HasCollectionChangeHandlers; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
24 import org.dive4elements.river.client.client.event.HasOutputModesChangeHandlers; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
25 import org.dive4elements.river.client.client.event.OutputModesChangeEvent; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
26 import org.dive4elements.river.client.client.event.OutputModesChangeHandler; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
27 import org.dive4elements.river.client.client.event.ParameterChangeEvent; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
28 import org.dive4elements.river.client.client.event.ParameterChangeHandler; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
29 import org.dive4elements.river.client.client.services.AddArtifactService; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
30 import org.dive4elements.river.client.client.services.AddArtifactServiceAsync; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
31 import org.dive4elements.river.client.client.services.CollectionAttributeService; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
32 import org.dive4elements.river.client.client.services.CollectionAttributeServiceAsync; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
33 import org.dive4elements.river.client.client.services.CreateCollectionService; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
34 import org.dive4elements.river.client.client.services.CreateCollectionServiceAsync; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
35 import org.dive4elements.river.client.client.services.DescribeCollectionService; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
36 import org.dive4elements.river.client.client.services.DescribeCollectionServiceAsync; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
37 import org.dive4elements.river.client.client.services.LoadArtifactService; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
38 import org.dive4elements.river.client.client.services.LoadArtifactServiceAsync; |
9561 | 39 import org.dive4elements.river.client.client.ui.map.MapOutputTab; |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
40 import org.dive4elements.river.client.shared.model.Artifact; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
41 import org.dive4elements.river.client.shared.model.ArtifactDescription; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
42 import org.dive4elements.river.client.shared.model.Collection; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
43 import org.dive4elements.river.client.shared.model.ExportMode; |
9484 | 44 import org.dive4elements.river.client.shared.model.MapMode; |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
45 import org.dive4elements.river.client.shared.model.OutputMode; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
46 import org.dive4elements.river.client.shared.model.Recommendation; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
47 import org.dive4elements.river.client.shared.model.ReportMode; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
48 import org.dive4elements.river.client.shared.model.User; |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
50 import com.google.gwt.core.client.GWT; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
51 import com.google.gwt.user.client.rpc.AsyncCallback; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
52 import com.smartgwt.client.util.SC; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
53 import com.smartgwt.client.widgets.Window; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
54 import com.smartgwt.client.widgets.events.CloseClickEvent; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
55 import com.smartgwt.client.widgets.events.CloseClickHandler; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
56 import com.smartgwt.client.widgets.layout.Layout; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
57 import com.smartgwt.client.widgets.layout.VLayout; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
58 import com.smartgwt.client.widgets.tab.TabSet; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
59 import com.smartgwt.client.widgets.tab.events.TabSelectedHandler; |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 |
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 /** |
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 */ |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
64 public class CollectionView extends Window implements CollectionChangeHandler, HasCollectionChangeHandlers, OutputModesChangeHandler, HasOutputModesChangeHandlers, ParameterChangeHandler, CloseClickHandler { |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
65 |
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
66 /** The message class that provides i18n strings. */ |
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
67 private static final FLYSConstants messages = GWT.create(FLYSConstants.class); |
26
c19985f75118
Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
23
diff
changeset
|
68 |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
69 /** The ArtifactService used to communicate with the Artifact server. */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
70 private final CreateCollectionServiceAsync createCollectionService = GWT.create(CreateCollectionService.class); |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
71 |
71
987567f31200
Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
60
diff
changeset
|
72 /** The AddArtifactService used to add an artifact to a collection. */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
73 private final AddArtifactServiceAsync addArtifactService = GWT.create(AddArtifactService.class); |
71
987567f31200
Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
60
diff
changeset
|
74 |
100
95b30a5d6350
Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
92
diff
changeset
|
75 /** The DescribeCollectionService used to update the existing collection. */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
76 private final DescribeCollectionServiceAsync describeCollectionService = GWT.create(DescribeCollectionService.class); |
100
95b30a5d6350
Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
92
diff
changeset
|
77 |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
78 private final CollectionAttributeServiceAsync updater = GWT.create(CollectionAttributeService.class); |
809
e9337488bac3
The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
807
diff
changeset
|
79 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
80 /** The LoadArtifactService used to load recommendations */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
81 private final LoadArtifactServiceAsync loadArtifactService = GWT.create(LoadArtifactService.class); |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
862
diff
changeset
|
83 /** The FLYS instance used to call services. */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
84 private final FLYS flys; |
13
8d9075c07667
Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
7
diff
changeset
|
85 |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
862
diff
changeset
|
86 /** The ParameterList. */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
87 private ParameterList parameterList; |
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:
19
diff
changeset
|
88 |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
862
diff
changeset
|
89 /** The list of CollectionChangeHandlers. */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
90 private final List<CollectionChangeHandler> handlers; |
19
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
91 |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
862
diff
changeset
|
92 /** The list of OutputModesChangeHandlers. */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
93 private final List<OutputModesChangeHandler> outHandlers; |
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:
437
diff
changeset
|
94 |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
862
diff
changeset
|
95 /** The collection to be displayed. */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
96 private Collection collection; |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
862
diff
changeset
|
98 /** The artifact that handles the parameterization. */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
99 private Artifact artifact; |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
26
diff
changeset
|
100 |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
101 private final TabSet tabs; |
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:
19
diff
changeset
|
102 |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
862
diff
changeset
|
103 /** The output tab. */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
104 private final Map<String, OutputTab> outputTabs; |
9484 | 105 private final List<String> tabNames = new ArrayList<String>(); |
7
a65793e08245
Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
106 |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
862
diff
changeset
|
107 /** The layout. */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
108 private final Layout layout; |
3366
8bedd1fcaeee
Removed trailing whitespace. Import cleanup
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3363
diff
changeset
|
109 |
5487
a87fe0d2c928
CollectionView: removed and use functionality that was moved to LockScreen.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4690
diff
changeset
|
110 /** Layout to show spinning wheel of joy. */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
111 private VLayout lockScreen; |
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:
19
diff
changeset
|
112 |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
113 private final int artifactsQueue; |
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
114 private final Stack<Recommendation> newRecommendations; |
809
e9337488bac3
The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
807
diff
changeset
|
115 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
116 /** Values for fix analysis charts */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
117 private double currentKm; |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 |
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 /** |
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 * This constructor creates a new CollectionView that is used to display the |
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 * <i>collection</i>. |
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 */ |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
123 public CollectionView(final FLYS flys) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
124 this.flys = flys; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
125 this.tabs = new TabSet(); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
126 this.outputTabs = new HashMap<String, OutputTab>(); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
127 this.handlers = new ArrayList<CollectionChangeHandler>(); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
128 this.outHandlers = new ArrayList<OutputModesChangeHandler>(); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
129 this.layout = new VLayout(); |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
130 this.parameterList = new ParameterList(flys, this, CollectionView.messages.new_project()); |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
131 this.artifactsQueue = 0; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
132 this.newRecommendations = new Stack<Recommendation>(); |
19
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
133 |
2906
1780841d79af
Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2905
diff
changeset
|
134 this.currentKm = -1d; |
1780841d79af
Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2905
diff
changeset
|
135 |
19
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
136 addCollectionChangeHandler(this); |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
137 addCollectionChangeHandler(this.parameterList); |
611
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
601
diff
changeset
|
138 addCollectionChangeHandler(flys); |
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:
437
diff
changeset
|
139 addOutputModesChangeHandler(this); |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
140 addOutputModesChangeHandler(this.parameterList); |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
537
diff
changeset
|
141 addCloseClickHandler(this); |
73
39210a74db07
Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
72
diff
changeset
|
142 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
143 this.parameterList.addParameterChangeHandler(this); |
19
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
144 |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 init(); |
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 } |
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 |
1557
964e90c5b4c1
Invested 2 seconds after losing 3.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1539
diff
changeset
|
148 /** |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
149 * @param collection |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
150 * The collection to be displayed. |
1557
964e90c5b4c1
Invested 2 seconds after losing 3.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1539
diff
changeset
|
151 */ |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
152 public CollectionView(final FLYS flys, final Collection collection, final Artifact artifact) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
153 this.flys = flys; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
154 this.artifact = artifact; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
155 this.collection = collection; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
156 this.tabs = new TabSet(); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
157 this.outputTabs = new HashMap<String, OutputTab>(); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
158 this.handlers = new ArrayList<CollectionChangeHandler>(); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
159 this.outHandlers = new ArrayList<OutputModesChangeHandler>(); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
160 this.layout = new VLayout(); |
1294
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1270
diff
changeset
|
161 |
2906
1780841d79af
Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2905
diff
changeset
|
162 this.currentKm = -1d; |
1780841d79af
Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2905
diff
changeset
|
163 |
1294
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1270
diff
changeset
|
164 if (artifact != null) { |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
165 this.parameterList = new ParameterList(flys, this, |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
166 // FIXME: literally every information about the artifact is transported from the server side |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
167 // but... the international name is resolved client-side.... Instead also transport the description of the artifact and |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
168 // use it! |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
169 // FIXME: the same holds for a very few other international strings (e.g. names of facets used in Tabs) |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
170 CollectionView.messages.getString(artifact.getName()), artifact); |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
171 } else { |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
172 this.parameterList = new ParameterList(flys, this, CollectionView.messages.new_project()); |
1294
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1270
diff
changeset
|
173 } |
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1270
diff
changeset
|
174 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
175 this.artifactsQueue = 0; |
809
e9337488bac3
The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
807
diff
changeset
|
176 this.newRecommendations = new Stack<Recommendation>(); |
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
|
177 |
a4a68b4ee2a3
Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
215
diff
changeset
|
178 addCollectionChangeHandler(this); |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
179 addCollectionChangeHandler(this.parameterList); |
611
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
601
diff
changeset
|
180 addCollectionChangeHandler(flys); |
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:
437
diff
changeset
|
181 addOutputModesChangeHandler(this); |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
182 addOutputModesChangeHandler(this.parameterList); |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
537
diff
changeset
|
183 addCloseClickHandler(this); |
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
|
184 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
185 this.parameterList.addParameterChangeHandler(this); |
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
|
186 |
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
|
187 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
|
188 |
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
|
189 setCollection(collection); |
1294
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1270
diff
changeset
|
190 |
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1270
diff
changeset
|
191 if (artifact != null) { |
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1270
diff
changeset
|
192 setArtifact(artifact); |
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1270
diff
changeset
|
193 } |
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
|
194 } |
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
|
195 |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
196 /** |
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
197 * This method handles the initial layout stuff. |
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
198 */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
199 private void init() { |
3347
6d749af6a9c2
Issue #726 work.
Christian Lins <christian.lins@intevation.de>
parents:
2983
diff
changeset
|
200 setWidth(1010); |
6d749af6a9c2
Issue #726 work.
Christian Lins <christian.lins@intevation.de>
parents:
2983
diff
changeset
|
201 setHeight(700); |
3547
8a16ff3b9a7f
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3522
diff
changeset
|
202 |
3522
6eeacd0bbe26
New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents:
3501
diff
changeset
|
203 setMaximized(true); |
3547
8a16ff3b9a7f
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3522
diff
changeset
|
204 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
205 this.layout.setWidth100(); |
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:
19
diff
changeset
|
206 |
77
5b5ec0403844
Limited the area for CollectionView to the size of FLYSWorkspace.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
75
diff
changeset
|
207 setCanDragReposition(true); |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
208 setCanDragResize(true); |
437
7fa15845fecf
ISSUE-35 The project view has a maximize button now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
276
diff
changeset
|
209 setShowMaximizeButton(true); |
77
5b5ec0403844
Limited the area for CollectionView to the size of FLYSWorkspace.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
75
diff
changeset
|
210 setKeepInParentRect(true); |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
211 |
84
b8acb6a615f2
Removed the title (date string) of CollectionViews.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
212 setTitle(""); |
7
a65793e08245
Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
213 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
214 addItem(this.layout); |
7
a65793e08245
Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
215 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
216 this.layout.addMember(this.tabs); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
217 this.tabs.addTab(this.parameterList); |
7
a65793e08245
Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
218 } |
a65793e08245
Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
219 |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
220 private FLYS getFlys() { |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
221 return this.flys; |
26
c19985f75118
Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
23
diff
changeset
|
222 } |
c19985f75118
Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
23
diff
changeset
|
223 |
c19985f75118
Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
23
diff
changeset
|
224 /** |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
862
diff
changeset
|
225 * This method registers a new CollectionChangeHandler. |
19
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
226 * |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
227 * @param handler |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
228 * The new CollectionChangeHandler. |
19
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
229 */ |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2906
diff
changeset
|
230 @Override |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
231 public void addCollectionChangeHandler(final CollectionChangeHandler handler) { |
19
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
232 if (handler != null) { |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
233 this.handlers.add(handler); |
19
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
234 } |
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
235 } |
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
236 |
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:
437
diff
changeset
|
237 /** |
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:
437
diff
changeset
|
238 * This method registers a new OutputModesChangeHandler. |
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:
437
diff
changeset
|
239 * |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
240 * @param handler |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
241 * The new OutputModesChangeHandler. |
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:
437
diff
changeset
|
242 */ |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2906
diff
changeset
|
243 @Override |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
244 public void addOutputModesChangeHandler(final OutputModesChangeHandler handler) { |
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:
437
diff
changeset
|
245 if (handler != null) { |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
246 this.outHandlers.add(handler); |
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:
437
diff
changeset
|
247 } |
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:
437
diff
changeset
|
248 } |
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:
437
diff
changeset
|
249 |
36
3cacc9d2dd01
CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
250 /** |
19
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
251 * This method calls the <code>onValueChange()</code> method of all |
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
252 * registered ValueChangeHanders. |
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
253 */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
254 private void fireCollectionChangeEvent(final Collection old, final Collection newCol) { |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
255 for (final CollectionChangeHandler handler : this.handlers) { |
19
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
256 handler.onCollectionChange(new CollectionChangeEvent(old, newCol)); |
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
257 } |
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
258 } |
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
259 |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
260 private void fireOutputModesChangeEvent(final OutputMode[] outputs) { |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
261 if (this.collection == null) { |
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:
437
diff
changeset
|
262 return; |
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:
437
diff
changeset
|
263 } |
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:
437
diff
changeset
|
264 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
265 for (final OutputModesChangeHandler handler : this.outHandlers) { |
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:
437
diff
changeset
|
266 handler.onOutputModesChange(new OutputModesChangeEvent(outputs)); |
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:
437
diff
changeset
|
267 } |
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:
437
diff
changeset
|
268 } |
3366
8bedd1fcaeee
Removed trailing whitespace. Import cleanup
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3363
diff
changeset
|
269 |
3549
6a8f83c538e3
Merged revisions 5384 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3547
diff
changeset
|
270 /** Disables input, grey out, show spinning wheel of joy. */ |
3353
08f8524a81ad
Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
271 public void lockUI() { |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
272 this.lockScreen = ScreenLock.lockUI(this.layout, this.lockScreen); |
3353
08f8524a81ad
Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
273 } |
3366
8bedd1fcaeee
Removed trailing whitespace. Import cleanup
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3363
diff
changeset
|
274 |
3549
6a8f83c538e3
Merged revisions 5384 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3547
diff
changeset
|
275 /** Enable input, remove grey, remove spinning wheel of joy. */ |
3353
08f8524a81ad
Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
276 public void unlockUI() { |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
277 ScreenLock.unlockUI(this.layout, this.lockScreen); |
3353
08f8524a81ad
Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
278 } |
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:
437
diff
changeset
|
279 |
19
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
280 /** |
71
987567f31200
Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
60
diff
changeset
|
281 * Returns the artifact that is used for the parameterization. |
987567f31200
Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
60
diff
changeset
|
282 * |
987567f31200
Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
60
diff
changeset
|
283 * @return the artifact that is used for the parameterization. |
987567f31200
Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
60
diff
changeset
|
284 */ |
521
fc60822e9c89
Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
513
diff
changeset
|
285 public Artifact getArtifact() { |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
286 return this.artifact; |
71
987567f31200
Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
60
diff
changeset
|
287 } |
987567f31200
Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
60
diff
changeset
|
288 |
811
8fa303586f14
Pass user id to the meta data service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
809
diff
changeset
|
289 public User getUser() { |
8fa303586f14
Pass user id to the meta data service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
809
diff
changeset
|
290 return getFlys().getCurrentUser(); |
8fa303586f14
Pass user id to the meta data service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
809
diff
changeset
|
291 } |
8fa303586f14
Pass user id to the meta data service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
809
diff
changeset
|
292 |
71
987567f31200
Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
60
diff
changeset
|
293 /** |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
26
diff
changeset
|
294 * Set the current artifact that is the master of the parameterization. |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
26
diff
changeset
|
295 * |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
296 * @param artifact |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
297 * The new artifact. |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
26
diff
changeset
|
298 */ |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
299 public void setArtifact(final Artifact artifact) { |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
26
diff
changeset
|
300 this.artifact = artifact; |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
847
diff
changeset
|
301 |
1270
ea9a73782de4
Bugfix: #321 Refresh the parameter list after a calculation is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
917
diff
changeset
|
302 artifactChanged(); |
ea9a73782de4
Bugfix: #321 Refresh the parameter list after a calculation is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
917
diff
changeset
|
303 |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
847
diff
changeset
|
304 if (artifact.isInBackground()) { |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
305 final LoadingPanel p = new LoadingPanel(this, artifact); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
306 p.addStepBackHandler(this.parameterList); |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
847
diff
changeset
|
307 } |
36
3cacc9d2dd01
CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
308 } |
3cacc9d2dd01
CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
309 |
3cacc9d2dd01
CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
310 /** |
3cacc9d2dd01
CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
311 * Implements the onCollectionChange() method to do update the GUI after the |
3cacc9d2dd01
CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
312 * parameterization has changed. |
3cacc9d2dd01
CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
313 * |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
314 * @param event |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
315 * The ParameterChangeEvent. |
36
3cacc9d2dd01
CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
316 */ |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2906
diff
changeset
|
317 @Override |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
318 public void onParameterChange(final ParameterChangeEvent event) { |
100
95b30a5d6350
Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
92
diff
changeset
|
319 GWT.log("CollectionView.onParameterChange"); |
1270
ea9a73782de4
Bugfix: #321 Refresh the parameter list after a calculation is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
917
diff
changeset
|
320 setArtifact(event.getNewValue()); |
ea9a73782de4
Bugfix: #321 Refresh the parameter list after a calculation is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
917
diff
changeset
|
321 } |
100
95b30a5d6350
Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
92
diff
changeset
|
322 |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
323 private void artifactChanged() { |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
324 final Collection c = getCollection(); |
100
95b30a5d6350
Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
92
diff
changeset
|
325 |
908
a680ccec5dd6
Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
326 if (c != null) { |
4661
5025acdb3815
Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4660
diff
changeset
|
327 loadCollection(c); |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
328 } else { |
71
987567f31200
Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
60
diff
changeset
|
329 updateView(); |
987567f31200
Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
60
diff
changeset
|
330 } |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
331 } |
13
8d9075c07667
Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
7
diff
changeset
|
332 |
4661
5025acdb3815
Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4660
diff
changeset
|
333 /** |
6578 | 334 * Loads all information of a collection. |
335 * If 'recommendations' present, load these. | |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
336 * |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
337 * @param c |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
338 * the Collection |
4661
5025acdb3815
Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4660
diff
changeset
|
339 */ |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
340 private void loadCollection(final Collection c) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
341 final ArtifactDescription desc = getArtifact().getArtifactDescription(); |
4661
5025acdb3815
Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4660
diff
changeset
|
342 final Recommendation[] recom = desc.getRecommendations(); |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
343 final String locale = Config.getInstance().getLocale(); |
4661
5025acdb3815
Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4660
diff
changeset
|
344 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
345 this.describeCollectionService.describe(c.identifier(), locale, new AsyncCallback<Collection>() { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
346 @Override |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
347 public void onFailure(final Throwable caught) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
348 GWT.log("Could not DESCRIBE collection."); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
349 SC.warn(FLYS.getExceptionString(CollectionView.this.messages, caught)); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
350 } |
4661
5025acdb3815
Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4660
diff
changeset
|
351 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
352 @Override |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
353 public void onSuccess(final Collection newCollection) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
354 GWT.log("Successfully DESCRIBED collection."); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
355 boolean loaded = true; |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
356 for (final Recommendation r : recom) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
357 if (!newCollection.loadedRecommendation(r)) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
358 loaded = false; |
4661
5025acdb3815
Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4660
diff
changeset
|
359 } |
5025acdb3815
Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4660
diff
changeset
|
360 } |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
361 if (!loaded) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
362 loadRecommendedArtifacts(recom); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
363 } else { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
364 setCollection(newCollection); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
365 } |
4661
5025acdb3815
Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4660
diff
changeset
|
366 } |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
367 }); |
4661
5025acdb3815
Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4660
diff
changeset
|
368 } |
5025acdb3815
Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4660
diff
changeset
|
369 |
13
8d9075c07667
Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
7
diff
changeset
|
370 /** |
74
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
371 * Returns the collection of displayed by this view. |
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
372 * |
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
373 * @return the collection of this view. |
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
374 */ |
537
d2c37ba78feb
The collection object in the CollectionView is now accessible via getter method.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
521
diff
changeset
|
375 public Collection getCollection() { |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
376 return this.collection; |
74
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
377 } |
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
378 |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
379 private void setCollection(final Collection collection) { |
908
a680ccec5dd6
Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
380 setCollection(collection, false); |
a680ccec5dd6
Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
381 } |
a680ccec5dd6
Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
382 |
74
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
383 /** |
19
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
384 * Set the current collection. |
13
8d9075c07667
Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
7
diff
changeset
|
385 * |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
386 * @param collection |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
387 * The new collection. |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
388 * @param suppress |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
389 * Whether to fire a collectionchangeevent. |
13
8d9075c07667
Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
7
diff
changeset
|
390 */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
391 public void setCollection(final Collection collection, final boolean suppress) { |
601
3cf6ee30207c
Register newly created CollectionViews at FLYSWorkspace to avoid an inconsistent view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
593
diff
changeset
|
392 if (collection != null && this.collection == null) { |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
393 this.flys.getWorkspace().addView(collection.identifier(), this); |
601
3cf6ee30207c
Register newly created CollectionViews at FLYSWorkspace to avoid an inconsistent view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
593
diff
changeset
|
394 } |
3cf6ee30207c
Register newly created CollectionViews at FLYSWorkspace to avoid an inconsistent view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
593
diff
changeset
|
395 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
396 final Collection tmp = this.collection; |
19
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
397 this.collection = collection; |
13
8d9075c07667
Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
7
diff
changeset
|
398 |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
399 if (collection != null) |
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
400 setTitle(collection.getDisplayName()); |
908
a680ccec5dd6
Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
401 |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
402 if (!suppress) |
908
a680ccec5dd6
Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
403 fireCollectionChangeEvent(tmp, this.collection); |
19
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
404 } |
f48b2cb2e219
The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
405 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2906
diff
changeset
|
406 @Override |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
407 public void onCollectionChange(final CollectionChangeEvent event) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
408 if (this.artifactsQueue > 0) { |
809
e9337488bac3
The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
807
diff
changeset
|
409 GWT.log("Do not update UI because we are still loading Artifacts."); |
e9337488bac3
The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
807
diff
changeset
|
410 return; |
e9337488bac3
The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
807
diff
changeset
|
411 } |
e9337488bac3
The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
807
diff
changeset
|
412 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
413 final Collection newCol = event.getNewValue(); |
74
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
414 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
415 final Map<String, OutputMode> outs = newCol.getOutputModes(); |
74
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
416 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
417 final Set<String> keys = outs.keySet(); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
418 final OutputMode[] prepared = 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:
437
diff
changeset
|
419 |
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:
437
diff
changeset
|
420 int idx = 0; |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
421 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:
437
diff
changeset
|
422 prepared[idx++] = outs.get(outname); |
74
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
423 } |
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
424 |
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:
437
diff
changeset
|
425 fireOutputModesChangeEvent(prepared); |
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:
437
diff
changeset
|
426 |
13
8d9075c07667
Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
7
diff
changeset
|
427 updateView(); |
8d9075c07667
Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
7
diff
changeset
|
428 } |
8d9075c07667
Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
7
diff
changeset
|
429 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2906
diff
changeset
|
430 @Override |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
431 public void onOutputModesChange(final OutputModesChangeEvent event) { |
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:
611
diff
changeset
|
432 clearOutputTabs(); |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
433 final OutputMode[] outs = event.getOutputModes(); |
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:
437
diff
changeset
|
434 |
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:
437
diff
changeset
|
435 if (outs == null) { |
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:
437
diff
changeset
|
436 return; |
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:
437
diff
changeset
|
437 } |
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:
437
diff
changeset
|
438 |
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:
611
diff
changeset
|
439 boolean hasCSV = 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:
611
diff
changeset
|
440 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
441 for (final OutputMode out : 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:
437
diff
changeset
|
442 addOutputTab(out.getName(), out); |
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:
611
diff
changeset
|
443 |
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:
611
diff
changeset
|
444 if (out instanceof ExportMode) { |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
445 final ExportMode export = (ExportMode) out; |
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:
611
diff
changeset
|
446 |
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:
611
diff
changeset
|
447 if (export.getFacet("csv") != null) { |
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:
611
diff
changeset
|
448 hasCSV = true; |
dfbc6693247e
Integrated a stacked panel on the right side of the ParameterList that enables users to see calculation results and the helper panel at the same time.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
611
diff
changeset
|
449 } |
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:
611
diff
changeset
|
450 } |
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:
611
diff
changeset
|
451 } |
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:
611
diff
changeset
|
452 |
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:
611
diff
changeset
|
453 if (!hasCSV) { |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
454 this.parameterList.removeTable(); |
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:
437
diff
changeset
|
455 } |
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:
437
diff
changeset
|
456 } |
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:
437
diff
changeset
|
457 |
36
3cacc9d2dd01
CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
458 /** |
74
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
459 * Adds a new tab for the OutputMode <i>out</i>. |
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
460 * |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
461 * @param name |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
462 * The name and title of the output. |
74
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
463 */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
464 private void addOutputTab(final String name, final OutputMode out) { |
270
d01b0d81b92a
Parse the facets of a Collection and distinguish between an ordinary OutputMode and an ExportMode (new).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
260
diff
changeset
|
465 if (out instanceof ExportMode) { |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
466 final ExportMode export = (ExportMode) out; |
256
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
239
diff
changeset
|
467 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
468 if (export.getFacet("csv") != null && !this.parameterList.hasTable()) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
469 final TableDataPanel p = new TableDataPanel(); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
470 p.setUuid(this.collection.identifier()); |
270
d01b0d81b92a
Parse the facets of a Collection and distinguish between an ordinary OutputMode and an ExportMode (new).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
260
diff
changeset
|
471 p.setName(out.getName()); |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
472 this.parameterList.setTable(p); |
270
d01b0d81b92a
Parse the facets of a Collection and distinguish between an ordinary OutputMode and an ExportMode (new).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
260
diff
changeset
|
473 } |
d01b0d81b92a
Parse the facets of a Collection and distinguish between an ordinary OutputMode and an ExportMode (new).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
260
diff
changeset
|
474 |
239
47fe77a1bac7
Added new i18n strings for new output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
475 return; |
47fe77a1bac7
Added new i18n strings for new output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
476 } |
47fe77a1bac7
Added new i18n strings for new output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
477 |
9484 | 478 else if (out instanceof ReportMode) { |
593
c0477626ae6a
#156 Do not display report modes as tabs in the project view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
582
diff
changeset
|
479 // we don't want to display report modes at all |
c0477626ae6a
#156 Do not display report modes as tabs in the project view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
582
diff
changeset
|
480 return; |
9484 | 481 } else if (out instanceof MapMode) { |
9561 | 482 // this workaround is not needed anymore - it is now in clearOuputTabs |
483 // if (this.tabNames.contains("map")) | |
484 // return; | |
593
c0477626ae6a
#156 Do not display report modes as tabs in the project view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
582
diff
changeset
|
485 } |
c0477626ae6a
#156 Do not display report modes as tabs in the project view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
582
diff
changeset
|
486 |
74
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
487 GWT.log("Add new output tab for '" + name + "'"); |
75
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
74
diff
changeset
|
488 |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
489 final String title = CollectionView.messages.getString(name); |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
490 final OutputTab tab = out.createOutputTab(title, getCollection(), this); |
796
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
491 |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
492 if (tab != null) |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
493 this.outputTabs.put(name, tab); |
74
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
494 } |
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
495 |
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
496 /** |
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
497 * Removes all output mode tabs from tab bar. |
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
498 */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
499 private void clearOutputTabs() { |
74
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
500 GWT.log("Clear OutputTabs."); |
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
501 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
502 final int num = this.tabs.getNumTabs(); |
74
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
503 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
504 for (int i = num - 1; i >= 1; i--) { |
9561 | 505 if (this.tabs.getTab(i) instanceof MapOutputTab) { |
506 final MapOutputTab mot = (MapOutputTab) this.tabs.getTab(i); | |
507 mot.cancelMapService(); // MapOutputTab needs special treatment | |
508 } | |
509 this.tabs.removeTab(i); | |
74
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
510 } |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
511 this.outputTabs.clear(); |
74
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
512 } |
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
513 |
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
514 /** |
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:
19
diff
changeset
|
515 * Update the view (refresh the list of old and current data). |
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:
19
diff
changeset
|
516 */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
517 private void updateView() { |
36
3cacc9d2dd01
CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
518 GWT.log("CollectionView.updateView()"); |
74
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
519 updateOutputTabs(); |
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
520 } |
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:
19
diff
changeset
|
521 |
74
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
522 /** |
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
523 * This method is used to update the tabs to show specific output modes. |
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
524 */ |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
525 private void updateOutputTabs() { |
74
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
526 GWT.log("Update output tabs."); |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
527 if (this.outputTabs != null) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
528 final Set<String> keys = this.outputTabs.keySet(); |
74
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
529 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
530 for (final String key : keys) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
531 this.tabs.addTab(this.outputTabs.get(key)); |
9484 | 532 this.tabNames.add(key); |
74
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
533 } |
c5586446f3c0
Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
73
diff
changeset
|
534 } |
13
8d9075c07667
Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
7
diff
changeset
|
535 } |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
537
diff
changeset
|
536 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2906
diff
changeset
|
537 @Override |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
538 public void onCloseClick(final CloseClickEvent event) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
539 if (this.collection != null) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
540 if (this.artifact != null) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
541 this.flys.closeProject(this.collection.identifier()); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
542 } else { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
543 this.flys.getProjectList().deleteCollection(this.collection); |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3366
diff
changeset
|
544 } |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
545 } else { |
611
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
601
diff
changeset
|
546 hide(); |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
601
diff
changeset
|
547 destroy(); |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
601
diff
changeset
|
548 } |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
537
diff
changeset
|
549 } |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
550 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
551 public void addArtifactToCollection(final Artifact artifact) { |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
552 final String locale = Config.getInstance().getLocale(); |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
553 |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
554 GWT.log("CollectionView.addArtifactToCollection " + this.collection); |
4659
518d60dfe6bf
Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4658
diff
changeset
|
555 |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
556 if (this.collection != null) { |
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
557 this.addArtifactService.add(this.collection, artifact, locale, new AsyncCallback<Collection>() { |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
558 @Override |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
559 public void onFailure(final Throwable caught) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
560 GWT.log("An error occured while adding artifact."); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
561 SC.warn(FLYS.getExceptionString(CollectionView.this.messages, caught)); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
562 } |
4659
518d60dfe6bf
Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4658
diff
changeset
|
563 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
564 @Override |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
565 public void onSuccess(final Collection newCollection) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
566 GWT.log("Successfully added artifacts."); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
567 setCollection(newCollection); |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
568 } |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
569 }); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
570 } else { |
6578 | 571 // Create new collection and add artifact. |
4659
518d60dfe6bf
Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4658
diff
changeset
|
572 final Artifact art = artifact; |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
573 this.createCollectionService.create(locale, this.flys.getCurrentUser().identifier(), new AsyncCallback<Collection>() { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
574 @Override |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
575 public void onFailure(final Throwable caught) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
576 GWT.log("Could not create the new collection."); |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
577 SC.warn(FLYS.getExceptionString(CollectionView.messages, caught)); |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
578 } |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
579 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
580 @Override |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
581 public void onSuccess(final Collection collection) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
582 GWT.log("Successfully created a new collection."); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
583 CollectionView.this.addArtifactService.add(collection, art, locale, new AsyncCallback<Collection>() { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
584 @Override |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
585 public void onFailure(final Throwable caught) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
586 GWT.log("An error occured while " + "adding artifact."); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
587 SC.warn(FLYS.getExceptionString(CollectionView.this.messages, caught)); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
588 } |
4659
518d60dfe6bf
Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4658
diff
changeset
|
589 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
590 @Override |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
591 public void onSuccess(final Collection newCollection) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
592 GWT.log("Successfully added artifacts."); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
593 setCollection(newCollection); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
594 } |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
595 }); |
809
e9337488bac3
The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
807
diff
changeset
|
596 } |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
597 }); |
4659
518d60dfe6bf
Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4658
diff
changeset
|
598 } |
809
e9337488bac3
The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
807
diff
changeset
|
599 } |
e9337488bac3
The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
807
diff
changeset
|
600 |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
601 private void addRecommendationsToCollection() { |
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
602 final String locale = Config.getInstance().getLocale(); |
809
e9337488bac3
The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
807
diff
changeset
|
603 |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
604 this.collection.addRecommendations(this.newRecommendations); |
809
e9337488bac3
The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
807
diff
changeset
|
605 |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
606 this.updater.update(this.collection, locale, new AsyncCallback<Collection>() { |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
607 @Override |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
608 public void onFailure(final Throwable caught) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
609 CollectionView.this.newRecommendations.removeAllElements(); |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
610 setCollection(CollectionView.this.collection); |
809
e9337488bac3
The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
807
diff
changeset
|
611 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
612 GWT.log("An error occured while saving recommendations."); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
613 SC.warn(FLYS.getExceptionString(CollectionView.this.messages, caught)); |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
614 } |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
615 |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
616 @Override |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
617 public void onSuccess(final Collection newCol) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
618 GWT.log("Successfully saved recommendations."); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
619 CollectionView.this.newRecommendations.removeAllElements(); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
620 setCollection(newCol); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
621 } |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
622 }); |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
623 } |
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
624 |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
625 private void loadRecommendedArtifacts(final Recommendation[] recommendations) { |
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
626 final String locale = Config.getInstance().getLocale(); |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
627 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
628 final Artifact masterArtifact = getArtifact(); |
847
25a4bf390757
Loading recommendations: If no reference artifact is given use current
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
845
diff
changeset
|
629 |
819
11fd6557d0fc
UI: Cosmetics in log messages of CollectionView.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
811
diff
changeset
|
630 if (recommendations == null) { |
11fd6557d0fc
UI: Cosmetics in log messages of CollectionView.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
811
diff
changeset
|
631 GWT.log("WARNING: Currently no recommendations."); |
11fd6557d0fc
UI: Cosmetics in log messages of CollectionView.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
811
diff
changeset
|
632 return; |
11fd6557d0fc
UI: Cosmetics in log messages of CollectionView.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
811
diff
changeset
|
633 } |
11fd6557d0fc
UI: Cosmetics in log messages of CollectionView.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
811
diff
changeset
|
634 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
635 for (final Recommendation recommendation : recommendations) { |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
636 if (this.collection.loadedRecommendation(recommendation)) { |
8717
68916dd6359b
Backout 8709:71ae18553377 Regression risk too high.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8716
diff
changeset
|
637 continue; |
68916dd6359b
Backout 8709:71ae18553377 Regression risk too high.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8716
diff
changeset
|
638 } |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
639 this.newRecommendations.push(recommendation); |
8717
68916dd6359b
Backout 8709:71ae18553377 Regression risk too high.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8716
diff
changeset
|
640 |
847
25a4bf390757
Loading recommendations: If no reference artifact is given use current
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
845
diff
changeset
|
641 // XXX: UGLY! If no reference artifact given use uuid of |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
642 // current artifact as reference. |
847
25a4bf390757
Loading recommendations: If no reference artifact is given use current
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
845
diff
changeset
|
643 if (recommendation.getMasterArtifact() == null) { |
25a4bf390757
Loading recommendations: If no reference artifact is given use current
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
845
diff
changeset
|
644 recommendation.setMasterArtifact(masterArtifact.getUuid()); |
25a4bf390757
Loading recommendations: If no reference artifact is given use current
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
845
diff
changeset
|
645 } |
25a4bf390757
Loading recommendations: If no reference artifact is given use current
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
845
diff
changeset
|
646 |
1515 | 647 } |
807
6f65e70fa11d
Repaired broken recommendation parsing from Artifact's DESCRIBE document (which structure has changed).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
648 |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
649 this.loadArtifactService.loadMany(this.collection, recommendations, null, locale, new AsyncCallback<Artifact[]>() { |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
650 @Override |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
651 public void onFailure(final Throwable caught) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
652 GWT.log("Error loading recommendations: " + caught.getMessage()); |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
653 SC.warn(FLYS.getExceptionString(CollectionView.messages, caught)); |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
654 } |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
655 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
656 @Override |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
657 public void onSuccess(final Artifact[] artifacts) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
658 GWT.log("Loaded artifacts: " + artifacts.length); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
659 addRecommendationsToCollection(); |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
660 } |
1515 | 661 }); |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
662 } |
915
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
908
diff
changeset
|
663 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
664 public void registerTabHandler(final TabSelectedHandler tse) { |
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
665 this.tabs.addTabSelectedHandler(tse); |
915
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
908
diff
changeset
|
666 } |
2906
1780841d79af
Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2905
diff
changeset
|
667 |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8860
diff
changeset
|
668 public void setCurrentKm(final double currentKm) { |
2906
1780841d79af
Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2905
diff
changeset
|
669 this.currentKm = currentKm; |
1780841d79af
Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2905
diff
changeset
|
670 } |
1780841d79af
Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2905
diff
changeset
|
671 |
1780841d79af
Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2905
diff
changeset
|
672 public double getCurrentKm() { |
1780841d79af
Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2905
diff
changeset
|
673 return this.currentKm; |
1780841d79af
Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2905
diff
changeset
|
674 } |
9263
abf14917be32
Moved stepping behaviour of NaviOutputChart into an exchangeable strategy.
gernotbelger
parents:
9150
diff
changeset
|
675 } |