annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/CollectionView.java @ 8860:28df64078f27

Merge with 0862ea5d66baf60e7eee496d130a35157cc9ec12
author gernotbelger
date Fri, 19 Jan 2018 11:23:42 +0100
parents 8c64617a7991 5e38e2924c07
children 23945061daec
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
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
11 import com.google.gwt.core.client.GWT;
5566
adb6c0f14810 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5487
diff changeset
12
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
13 import com.google.gwt.user.client.rpc.AsyncCallback;
4127
1e9e7b7d9f15 More fixes for #897: missing resource exceptions when handling other exceptions
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
14
215
e02f50a3ad59 Improved the exception handling of artifact / collection specific operations. Warning dialog are displayed after such an exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 211
diff changeset
15 import com.smartgwt.client.util.SC;
5566
adb6c0f14810 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5487
diff changeset
16
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 import com.smartgwt.client.widgets.Window;
5566
adb6c0f14810 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5487
diff changeset
18
1619
f8c03d3af300 Reactivated the Enterprise Blue theme. Fixes some icon and image issues in IE8.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1557
diff changeset
19 import com.smartgwt.client.widgets.events.CloseClickEvent;
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
20 import com.smartgwt.client.widgets.events.CloseClickHandler;
5566
adb6c0f14810 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5487
diff changeset
21
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
22 import com.smartgwt.client.widgets.layout.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
23 import com.smartgwt.client.widgets.layout.VLayout;
5566
adb6c0f14810 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5487
diff changeset
24
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
25 import com.smartgwt.client.widgets.tab.TabSet;
5566
adb6c0f14810 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5487
diff changeset
26
915
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 908
diff changeset
27 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
28
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
29 import org.dive4elements.river.client.client.Config;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
30 import org.dive4elements.river.client.client.FLYS;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
31 import org.dive4elements.river.client.client.FLYSConstants;
5566
adb6c0f14810 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5487
diff changeset
32
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
33 import org.dive4elements.river.client.client.event.CollectionChangeEvent;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
34 import org.dive4elements.river.client.client.event.CollectionChangeHandler;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
35 import org.dive4elements.river.client.client.event.HasCollectionChangeHandlers;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
36 import org.dive4elements.river.client.client.event.HasOutputModesChangeHandlers;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
37 import org.dive4elements.river.client.client.event.OutputModesChangeEvent;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
38 import org.dive4elements.river.client.client.event.OutputModesChangeHandler;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
39 import org.dive4elements.river.client.client.event.ParameterChangeEvent;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
40 import org.dive4elements.river.client.client.event.ParameterChangeHandler;
5566
adb6c0f14810 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5487
diff changeset
41
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
42 import org.dive4elements.river.client.client.services.AddArtifactService;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
43 import org.dive4elements.river.client.client.services.AddArtifactServiceAsync;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
44 import org.dive4elements.river.client.client.services.ArtifactService;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
45 import org.dive4elements.river.client.client.services.ArtifactServiceAsync;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
46 import org.dive4elements.river.client.client.services.CollectionAttributeService;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
47 import org.dive4elements.river.client.client.services.CollectionAttributeServiceAsync;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
48 import org.dive4elements.river.client.client.services.CreateCollectionService;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
49 import org.dive4elements.river.client.client.services.CreateCollectionServiceAsync;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
50 import org.dive4elements.river.client.client.services.DescribeCollectionService;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
51 import org.dive4elements.river.client.client.services.DescribeCollectionServiceAsync;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
52 import org.dive4elements.river.client.client.services.LoadArtifactService;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
53 import org.dive4elements.river.client.client.services.LoadArtifactServiceAsync;
5566
adb6c0f14810 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5487
diff changeset
54
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
55 import org.dive4elements.river.client.shared.model.Artifact;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
56 import org.dive4elements.river.client.shared.model.ArtifactDescription;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
57 import org.dive4elements.river.client.shared.model.Collection;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
58 import org.dive4elements.river.client.shared.model.ExportMode;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
59 import org.dive4elements.river.client.shared.model.OutputMode;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
60 import org.dive4elements.river.client.shared.model.Recommendation;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
61 import org.dive4elements.river.client.shared.model.ReportMode;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
62 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
63
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
64 import java.util.ArrayList;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
65 import java.util.HashMap;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
66 import java.util.List;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
67 import java.util.Map;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
68 import java.util.Set;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
69 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
70
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
71
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
72 /**
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
73 * @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
74 */
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
75 public class CollectionView
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
76 extends Window
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
77 implements CollectionChangeHandler, HasCollectionChangeHandlers,
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
78 OutputModesChangeHandler, HasOutputModesChangeHandlers,
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
79 ParameterChangeHandler, CloseClickHandler
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
80 {
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
81 /** The ArtifactService used to communicate with the Artifact server. */
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
82 protected CreateCollectionServiceAsync createCollectionService =
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
83 GWT.create(CreateCollectionService.class);
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
84
803
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
85 /** The ArtifactService used to communicate with the Artifact server. */
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
86 protected ArtifactServiceAsync createArtifactService =
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
87 GWT.create(ArtifactService.class);
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
88
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
89 /** The AddArtifactService used to add an artifact to a collection. */
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
90 protected AddArtifactServiceAsync addArtifactService =
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
91 GWT.create(AddArtifactService.class);
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
92
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
93 /** The DescribeCollectionService used to update the existing collection. */
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
94 protected DescribeCollectionServiceAsync describeCollectionService =
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
95 GWT.create(DescribeCollectionService.class);
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
96
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
97 protected CollectionAttributeServiceAsync updater =
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
98 GWT.create(CollectionAttributeService.class);
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
99
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
100 /** The LoadArtifactService used to load recommendations*/
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
101 protected LoadArtifactServiceAsync loadArtifactService =
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
102 GWT.create(LoadArtifactService.class);
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
103
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
104 /** The message class that provides i18n strings. */
211
b92281182c6b Removed the FLYSMessages interface and replaced it with a FLYSConstants interface - this interface has the ability to lookup i18n strings with given keys.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
105 protected FLYSConstants messages = GWT.create(FLYSConstants.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
106
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
107 /** The FLYS instance used to call services. */
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
108 protected FLYS flys;
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
109
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
110 /** The 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
111 protected ParameterList parameterList;
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
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
113 /** The list of CollectionChangeHandlers. */
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
114 protected List<CollectionChangeHandler> handlers;
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
115
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
116 /** The list of OutputModesChangeHandlers. */
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
117 protected List<OutputModesChangeHandler> outHandlers;
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
118
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
119 /** The collection to be displayed. */
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
120 protected Collection collection;
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
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
122 /** The artifact that handles the parameterization. */
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
123 protected Artifact artifact;
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
124
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
125 protected TabSet tabs;
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
126
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
127 /** The output 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
128 protected Map<String, OutputTab> outputTabs;
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
129
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
130 /** The layout. */
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
131 protected Layout layout;
3366
8bedd1fcaeee Removed trailing whitespace. Import cleanup
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3363
diff changeset
132
5487
a87fe0d2c928 CollectionView: removed and use functionality that was moved to LockScreen.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4690
diff changeset
133 /** Layout to 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
134 protected 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
135
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
136 protected int artifactsQueue;
1512
685bce693617 Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1493
diff changeset
137 protected int recommendationQueue;
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
138 protected Stack<Recommendation> newRecommendations;
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
139
2906
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
140 /** Values for fix analysis charts*/
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
141 protected double currentKm;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
142 protected double minKm;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
143 protected double maxKm;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
144 protected double steps;
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
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 * 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
148 * <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
149 */
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
150 public CollectionView(FLYS flys) {
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
151 this.flys = flys;
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
152 this.tabs = new TabSet();
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
153 this.outputTabs = new HashMap<String, OutputTab>();
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
154 this.handlers = new ArrayList<CollectionChangeHandler>();
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
155 this.outHandlers = new ArrayList<OutputModesChangeHandler>();
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
156 this.layout = new VLayout();
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
157 this.parameterList = new ParameterList(
92
fa3d9f79dff5 Changed some german strings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 91
diff changeset
158 flys, this, messages.new_project());
3363
8d38a1e097c2 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3353
diff changeset
159 this.artifactsQueue = 0;
1512
685bce693617 Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1493
diff changeset
160 this.recommendationQueue = 0;
3363
8d38a1e097c2 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3353
diff changeset
161 this.newRecommendations = new Stack<Recommendation>();
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
162
2906
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
163 this.currentKm = -1d;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
164 this.minKm = -1d;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
165 this.maxKm = -1d;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
166 this.steps = -1d;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
167
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
168 addCollectionChangeHandler(this);
275
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
169 addCollectionChangeHandler(parameterList);
611
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 601
diff changeset
170 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
171 addOutputModesChangeHandler(this);
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
172 addOutputModesChangeHandler(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
173 addCloseClickHandler(this);
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
174
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
175 parameterList.addParameterChangeHandler(this);
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
176
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
177 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
178 }
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
179
1557
964e90c5b4c1 Invested 2 seconds after losing 3.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1539
diff changeset
180 /**
964e90c5b4c1 Invested 2 seconds after losing 3.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1539
diff changeset
181 * @param collection The collection to be displayed.
964e90c5b4c1 Invested 2 seconds after losing 3.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1539
diff changeset
182 */
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
183 public CollectionView(FLYS flys, Collection collection, Artifact artifact) {
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
184 this.flys = flys;
825
1b9b7e9ab219 Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 820
diff changeset
185 this.artifact = artifact;
1b9b7e9ab219 Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 820
diff changeset
186 this.collection = collection;
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
187 this.tabs = new TabSet();
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 this.outputTabs = new HashMap<String, OutputTab>();
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 this.handlers = new ArrayList<CollectionChangeHandler>();
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
190 this.outHandlers = new ArrayList<OutputModesChangeHandler>();
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
191 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
192
2906
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
193 this.currentKm = -1d;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
194 this.minKm = -1d;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
195 this.maxKm = -1d;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
196 this.steps = -1d;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
197
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
198 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
199 this.parameterList = new ParameterList(
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
200 flys,
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
201 this,
8853
8c64617a7991 Some source code comments and fixme's
gernotbelger
parents: 8718
diff changeset
202 // FIXME: literally every information about the artifact is transported from the server side
8c64617a7991 Some source code comments and fixme's
gernotbelger
parents: 8718
diff changeset
203 // but... the international name is resolved client-side.... Instead also transport the description of the artifact and use it!
8c64617a7991 Some source code comments and fixme's
gernotbelger
parents: 8718
diff changeset
204 // FIXME: the same holds for a very few other international strings (e.g. names of facets used in Tabs)
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
205 messages.getString(artifact.getName()),
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
206 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
207 }
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
208 else {
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
209 this.parameterList = new ParameterList(
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
210 flys, this, messages.new_project());
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
211 }
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
212
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
213 this.artifactsQueue = 0;
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
214 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
215
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
216 addCollectionChangeHandler(this);
275
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
217 addCollectionChangeHandler(parameterList);
611
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 601
diff changeset
218 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
219 addOutputModesChangeHandler(this);
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
220 addOutputModesChangeHandler(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
221 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
222
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
223 parameterList.addParameterChangeHandler(this);
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
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
225 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
226
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
227 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
228
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
229 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
230 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
231 }
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
232 }
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
233
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
234
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
235 /**
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
236 * 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
237 */
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
238 protected void init() {
3347
6d749af6a9c2 Issue #726 work.
Christian Lins <christian.lins@intevation.de>
parents: 2983
diff changeset
239 setWidth(1010);
6d749af6a9c2 Issue #726 work.
Christian Lins <christian.lins@intevation.de>
parents: 2983
diff changeset
240 setHeight(700);
3547
8a16ff3b9a7f Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3522
diff changeset
241
3522
6eeacd0bbe26 New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents: 3501
diff changeset
242 setMaximized(true);
3547
8a16ff3b9a7f Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3522
diff changeset
243
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
244 layout.setWidth100();
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
245
77
5b5ec0403844 Limited the area for CollectionView to the size of FLYSWorkspace.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 75
diff changeset
246 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
247 setCanDragResize(true);
437
7fa15845fecf ISSUE-35 The project view has a maximize button now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 276
diff changeset
248 setShowMaximizeButton(true);
77
5b5ec0403844 Limited the area for CollectionView to the size of FLYSWorkspace.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 75
diff changeset
249 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
250
84
b8acb6a615f2 Removed the title (date string) of CollectionViews.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
251 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
252
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
253 addItem(layout);
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
254
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
255 layout.addMember(tabs);
90
f8c240f28c2a The title of the parameter tab will change after the module has been selectd.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 87
diff changeset
256 tabs.addTab(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
257 }
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
258
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
259 protected FLYS getFlys() {
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
260 return flys;
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
261 }
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
262
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
263
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
264 /**
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
265 * 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
266 *
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
267 * @param handler The new CollectionChangeHandler.
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
268 */
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
269 @Override
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
270 public void addCollectionChangeHandler(CollectionChangeHandler handler) {
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
271 if (handler != null) {
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
272 handlers.add(handler);
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
273 }
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
274 }
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
275
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
276
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
277 /**
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
278 * 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
279 *
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
280 * @param handler The 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
281 */
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
282 @Override
513
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 437
diff changeset
283 public void addOutputModesChangeHandler(OutputModesChangeHandler handler) {
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
284 if (handler != 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
285 outHandlers.add(handler);
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
286 }
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
287 }
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
288
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
289
36
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
290 /**
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
291 * 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
292 * registered ValueChangeHanders.
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
293 */
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
294 protected void fireCollectionChangeEvent(
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
295 Collection old, Collection newCol)
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
296 {
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
297 for (CollectionChangeHandler handler: handlers) {
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
298 handler.onCollectionChange(new CollectionChangeEvent(old, newCol));
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
299 }
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
300 }
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
301
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
302
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
303 protected void fireOutputModesChangeEvent(OutputMode[] 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
304 if (collection == 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
305 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
306 }
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
307
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
308 for (OutputModesChangeHandler handler: outHandlers) {
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
309 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
310 }
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
311 }
3366
8bedd1fcaeee Removed trailing whitespace. Import cleanup
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3363
diff changeset
312
8bedd1fcaeee Removed trailing whitespace. Import cleanup
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3363
diff changeset
313
3549
6a8f83c538e3 Merged revisions 5384 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3547
diff changeset
314 /** 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
315 public void lockUI() {
5487
a87fe0d2c928 CollectionView: removed and use functionality that was moved to LockScreen.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4690
diff changeset
316 lockScreen = ScreenLock.lockUI(layout, 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
317 }
3366
8bedd1fcaeee Removed trailing whitespace. Import cleanup
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3363
diff changeset
318
8bedd1fcaeee Removed trailing whitespace. Import cleanup
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3363
diff changeset
319
3549
6a8f83c538e3 Merged revisions 5384 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3547
diff changeset
320 /** 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
321 public void unlockUI() {
5487
a87fe0d2c928 CollectionView: removed and use functionality that was moved to LockScreen.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4690
diff changeset
322 ScreenLock.unlockUI(layout, 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
323 }
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
324
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
325
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
326 /**
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
327 * This method returns true, if the Collection is new and no plugins has
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
328 * been chosen.
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
329 *
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
330 * @return true, if the Collection is new.
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
331 */
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
332 public boolean isNew() {
4660
bb9ce9aece70 Add new method hasItems to Collection class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4659
diff changeset
333 return collection.hasItems();
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
334 }
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
335
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
336
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
337 /**
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
338 * 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
339 *
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
340 * @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
341 */
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
342 public Artifact getArtifact() {
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
343 return artifact;
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
344 }
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
345
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
346
811
8fa303586f14 Pass user id to the meta data service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 809
diff changeset
347 public User getUser() {
8fa303586f14 Pass user id to the meta data service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 809
diff changeset
348 return getFlys().getCurrentUser();
8fa303586f14 Pass user id to the meta data service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 809
diff changeset
349 }
8fa303586f14 Pass user id to the meta data service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 809
diff changeset
350
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
351
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
352 /**
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
353 * 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
354 *
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
355 * @param artifact The new artifact.
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
356 */
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
357 public void setArtifact(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
358 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
359
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
360 onArtifactChanged(artifact);
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
361 }
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
362
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
363
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
364 public void onArtifactChanged(Artifact artifact) {
1270
ea9a73782de4 Bugfix: #321 Refresh the parameter list after a calculation is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 917
diff changeset
365 artifactChanged();
ea9a73782de4 Bugfix: #321 Refresh the parameter list after a calculation is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 917
diff changeset
366
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
367 if (artifact.isInBackground()) {
1432
40f4137a2c31 Added a cancel button to the LoadingPanel which stops running WSPLGEN calculations (realized by returning to the previous state).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1425
diff changeset
368 LoadingPanel p = new LoadingPanel(this, artifact);
40f4137a2c31 Added a cancel button to the LoadingPanel which stops running WSPLGEN calculations (realized by returning to the previous state).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1425
diff changeset
369 p.addStepBackHandler(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
370 }
36
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
371 }
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
372
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
373
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
374 /**
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
375 * 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
376 * parameterization has changed.
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
377 *
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
378 * @param event The ParameterChangeEvent.
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
379 */
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
380 @Override
36
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
381 public void onParameterChange(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
382 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
383 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
384 }
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
385
1270
ea9a73782de4 Bugfix: #321 Refresh the parameter list after a calculation is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 917
diff changeset
386
ea9a73782de4 Bugfix: #321 Refresh the parameter list after a calculation is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 917
diff changeset
387 protected void artifactChanged() {
229
924da6695800 Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 228
diff changeset
388 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
389
908
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
390 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
391 loadCollection(c);
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
392 }
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
393 else {
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
394 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
395 }
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
396 }
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
397
4661
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
398 /**
6578
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5993
diff changeset
399 * Loads all information of a collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5993
diff changeset
400 * If 'recommendations' present, load these.
4661
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
401 * @param c the Collection
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
402 */
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
403 private void loadCollection(Collection c) {
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
404 ArtifactDescription desc = getArtifact().getArtifactDescription();
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
405 final Recommendation[] recom = desc.getRecommendations();
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
406 Config config = Config.getInstance();
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
407 String locale = config.getLocale();
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
408
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
409 describeCollectionService.describe(c.identifier(), locale,
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
410 new AsyncCallback<Collection>() {
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
411 @Override
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
412 public void onFailure(Throwable caught) {
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
413 GWT.log("Could not DESCRIBE collection.");
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
414 SC.warn(FLYS.getExceptionString(messages, caught));
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
415 }
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
416
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
417 @Override
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
418 public void onSuccess(Collection newCollection) {
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
419 GWT.log("Successfully DESCRIBED collection.");
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
420 boolean loaded = true;
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
421 for (Recommendation r: recom) {
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
422 if(!newCollection.loadedRecommendation(r)) {
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
423 loaded = false;
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
424 }
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
425 }
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
426 if (!loaded) {
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
427 loadRecommendedArtifacts(recom);
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
428 }
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
429 else {
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
430 setCollection(newCollection);
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
431 }
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
432 }
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
433 }
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
434 );
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
435 }
5025acdb3815 Move loading of the full Collection to an own method
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
436
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
437
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
438 /**
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
439 * 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
440 *
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
441 * @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
442 */
537
d2c37ba78feb The collection object in the CollectionView is now accessible via getter method.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 521
diff changeset
443 public Collection getCollection() {
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
444 return collection;
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
445 }
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
446
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
447
908
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
448 protected void setCollection(Collection collection) {
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
449 setCollection(collection, false);
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
450 }
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
451
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
452
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
453 /**
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
454 * 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
455 *
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
456 * @param collection The new collection.
1557
964e90c5b4c1 Invested 2 seconds after losing 3.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1539
diff changeset
457 * @param suppress 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
458 */
908
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
459 protected void setCollection(Collection collection, 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
460 if (collection != null && this.collection == null) {
3cf6ee30207c Register newly created CollectionViews at FLYSWorkspace to avoid an inconsistent view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 593
diff changeset
461 flys.getWorkspace().addView(collection.identifier(), this);
3cf6ee30207c Register newly created CollectionViews at FLYSWorkspace to avoid an inconsistent view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 593
diff changeset
462 }
3cf6ee30207c Register newly created CollectionViews at FLYSWorkspace to avoid an inconsistent view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 593
diff changeset
463
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
464 Collection tmp = this.collection;
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
465 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
466
4690
7c59baa150bd Use display name of the Collection in CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4661
diff changeset
467 setTitle(collection.getDisplayName());
908
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
468
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
469 if (!suppress) {
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
470 fireCollectionChangeEvent(tmp, this.collection);
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
471 }
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
472 }
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
473
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
474
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
475 @Override
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
476 public void onCollectionChange(CollectionChangeEvent event) {
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
477 if (artifactsQueue > 0) {
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
478 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
479 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
480 }
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
481
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
482 Collection newCol = event.getNewValue();
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
483
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
484 Map<String, OutputMode> outs = newCol.getOutputModes();
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
485
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
486 Set<String> keys = outs.keySet();
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
487 OutputMode[] prepared = new OutputMode[outs.size()];
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 437
diff changeset
488
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
489 int idx = 0;
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
490 for (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
491 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
492 }
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
493
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
494 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
495
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
496 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
497 }
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
498
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
499
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
500 @Override
513
e090fbd5a535 Added a mechanism to listen to changes relating to output modes of collections and artifacts. Solves a part of ISSUE-62.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 437
diff changeset
501 public void onOutputModesChange(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
502 clearOutputTabs();
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
503 OutputMode[] outs = event.getOutputModes();
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
504
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
505 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
506 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
507 }
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
508
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
509 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
510
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
511 for (OutputMode out: outs) {
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
512 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
513
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
514 if (out instanceof ExportMode) {
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
515 ExportMode export = (ExportMode) out;
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
516
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
517 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
518 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
519 }
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
520 }
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
521 }
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
522
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
523 if (!hasCSV) {
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
524 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
525 }
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
526 }
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
527
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
528
36
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
529 /**
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
530 * 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
531 *
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
532 * @param name The name and title of the output.
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 protected void addOutputTab(String name, 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
535 if (out instanceof ExportMode) {
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
536 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
537
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
538 if (export.getFacet("csv") != null && !parameterList.hasTable()) {
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
539 TableDataPanel p = new TableDataPanel();
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
540 p.setUuid(collection.identifier());
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
541 p.setName(out.getName());
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
542 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
543 }
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
544
239
47fe77a1bac7 Added new i18n strings for new output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
545 return;
47fe77a1bac7 Added new i18n strings for new output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
546 }
47fe77a1bac7 Added new i18n strings for new output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
547
593
c0477626ae6a #156 Do not display report modes as tabs in the project view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 582
diff changeset
548 if (out instanceof ReportMode) {
c0477626ae6a #156 Do not display report modes as tabs in the project view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 582
diff changeset
549 // 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
550 return;
c0477626ae6a #156 Do not display report modes as tabs in the project view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 582
diff changeset
551 }
c0477626ae6a #156 Do not display report modes as tabs in the project view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 582
diff changeset
552
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
553 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
554
796
cd8603aaa730 Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
555 String title = messages.getString(name);
cd8603aaa730 Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
556 OutputTab tab = out.createOutputTab(title, getCollection(), this);
cd8603aaa730 Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
557
cd8603aaa730 Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
558 if (tab != null) {
cd8603aaa730 Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
559 outputTabs.put(name, tab);
cd8603aaa730 Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
560 }
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
561 }
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
562
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
563
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
564 /**
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
565 * 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
566 */
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
567 protected void clearOutputTabs() {
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
568 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
569
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
570 int num = tabs.getNumTabs();
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
571
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
572 for (int i = num-1; i >= 1; 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
573 tabs.removeTab(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
574 }
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
575
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
576 outputTabs.clear();
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
577 }
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
578
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
579
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
580 /**
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
581 * 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
582 */
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
583 protected void updateView() {
36
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
584 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
585 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
586 }
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
587
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
588
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
589 /**
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
590 * 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
591 */
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
592 protected void 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
593 GWT.log("Update output tabs.");
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
594 if (outputTabs != null) {
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
595 Set<String> keys = outputTabs.keySet();
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
596
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
597 for (String key: keys) {
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
598 tabs.addTab(outputTabs.get(key));
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
599 }
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
600 }
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
601 }
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
602
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
603
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
604 @Override
1619
f8c03d3af300 Reactivated the Enterprise Blue theme. Fixes some icon and image issues in IE8.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1557
diff changeset
605 public void onCloseClick(CloseClickEvent event) {
611
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 601
diff changeset
606 if (collection != null) {
3501
0de0ef04bcdc Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
607 if(artifact != null) {
0de0ef04bcdc Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
608 flys.closeProject(collection.identifier());
0de0ef04bcdc Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
609 }
0de0ef04bcdc Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
610 else {
0de0ef04bcdc Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
611 flys.getProjectList().deleteCollection(collection);
0de0ef04bcdc Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
612 }
611
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 601
diff changeset
613 }
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 601
diff changeset
614 else {
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 601
diff changeset
615 hide();
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 601
diff changeset
616 destroy();
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 601
diff changeset
617 }
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
618 }
803
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
619
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
620
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
621 public void addArtifactToCollection(Artifact artifact) {
803
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
622 Config config = Config.getInstance();
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
623 final String locale = config.getLocale();
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
624 final Collection collection = getCollection();
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
625
4659
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
626 GWT.log("CollectionView.addArtifactToCollection " + collection);
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
627
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
628 if (collection != null) {
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
629 addArtifactService.add(
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
630 collection, artifact, locale,
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
631 new AsyncCallback<Collection>() {
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
632 @Override
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
633 public void onFailure(Throwable caught) {
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
634 GWT.log("An error occured while adding artifact.");
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
635 SC.warn(FLYS.getExceptionString(messages, caught));
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
636 }
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
637
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
638 @Override
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
639 public void onSuccess(Collection newCollection) {
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
640 GWT.log("Successfully added artifacts.");
8313
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 7934
diff changeset
641 setCollection(newCollection);
4659
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
642 }
803
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
643 }
4659
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
644 );
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
645 }
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
646 else {
6578
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5993
diff changeset
647 // 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
648 final Artifact art = artifact;
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
649 createCollectionService.create(
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
650 locale,
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
651 flys.getCurrentUser().identifier(),
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
652 new AsyncCallback<Collection>() {
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
653 @Override
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
654 public void onFailure(Throwable caught) {
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
655 GWT.log("Could not create the new collection.");
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
656 SC.warn(FLYS.getExceptionString(messages, caught));
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
657 }
803
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
658
4659
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
659 @Override
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
660 public void onSuccess(Collection collection) {
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
661 GWT.log("Successfully created a new collection.");
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
662 addArtifactService.add(
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
663 collection, art, locale,
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
664 new AsyncCallback<Collection>() {
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
665 @Override
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
666 public void onFailure(Throwable caught) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8718
diff changeset
667 GWT.log("An error occured while "
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8718
diff changeset
668 + "adding artifact.");
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8718
diff changeset
669 SC.warn(FLYS.getExceptionString(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8718
diff changeset
670 messages, caught));
4659
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
671 }
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
672
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
673 @Override
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8718
diff changeset
674 public void onSuccess(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8718
diff changeset
675 Collection newCollection) {
4659
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
676 GWT.log("Successfully added artifacts.");
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
677 setCollection(newCollection);
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
678 }
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
679 }
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
680 );
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
681 }
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
682 }
4659
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
683 );
518d60dfe6bf Create a Collection if an artifact is added to the CollectionView
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4658
diff changeset
684 }
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
685 }
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
686
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
687
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
688 protected void addRecommendationsToCollection() {
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
689 Config config = Config.getInstance();
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
690 final String locale = config.getLocale();
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
691 final Collection collection = getCollection();
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
692
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
693 collection.addRecommendations(newRecommendations);
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
694
1425
bc06a671ef60 Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1294
diff changeset
695 updater.update(collection, locale,
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
696 new AsyncCallback<Collection>() {
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
697 @Override
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
698 public void onFailure(Throwable caught) {
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
699 newRecommendations.removeAllElements();
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
700 setCollection(collection);
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
701
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
702 GWT.log("An error occured while saving recommendations.");
4127
1e9e7b7d9f15 More fixes for #897: missing resource exceptions when handling other exceptions
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
703 SC.warn(FLYS.getExceptionString(messages, caught));
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
704 }
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
705
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
706 @Override
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
707 public void onSuccess(Collection newCol) {
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
708 GWT.log("Successfully saved recommendations.");
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
709 newRecommendations.removeAllElements();
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
710 setCollection(newCol);
803
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
711 }
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
712 }
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
713 );
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
714 }
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
715
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
716
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
717 protected void loadRecommendedArtifacts(Recommendation[] recommendations) {
803
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
718 Config config = Config.getInstance();
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
719 final String locale = config.getLocale();
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
720 final Collection collection = getCollection();
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
721
847
25a4bf390757 Loading recommendations: If no reference artifact is given use current
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 845
diff changeset
722 Artifact masterArtifact = getArtifact();
25a4bf390757 Loading recommendations: If no reference artifact is given use current
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 845
diff changeset
723
819
11fd6557d0fc UI: Cosmetics in log messages of CollectionView.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 811
diff changeset
724 if (recommendations == null) {
11fd6557d0fc UI: Cosmetics in log messages of CollectionView.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 811
diff changeset
725 GWT.log("WARNING: Currently no recommendations.");
11fd6557d0fc UI: Cosmetics in log messages of CollectionView.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 811
diff changeset
726 return;
11fd6557d0fc UI: Cosmetics in log messages of CollectionView.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 811
diff changeset
727 }
11fd6557d0fc UI: Cosmetics in log messages of CollectionView.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 811
diff changeset
728
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
729 for (final Recommendation recommendation: recommendations) {
8717
68916dd6359b Backout 8709:71ae18553377 Regression risk too high.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8716
diff changeset
730 if (collection.loadedRecommendation(recommendation)) {
68916dd6359b Backout 8709:71ae18553377 Regression risk too high.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8716
diff changeset
731 continue;
68916dd6359b Backout 8709:71ae18553377 Regression risk too high.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8716
diff changeset
732 }
68916dd6359b Backout 8709:71ae18553377 Regression risk too high.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8716
diff changeset
733 newRecommendations.push(recommendation);
68916dd6359b Backout 8709:71ae18553377 Regression risk too high.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8716
diff changeset
734
847
25a4bf390757 Loading recommendations: If no reference artifact is given use current
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 845
diff changeset
735 // XXX: UGLY! If no reference artifact given use uuid of
2905
51ed89b754ae FLYS client: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2437
diff changeset
736 // 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
737 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
738 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
739 }
25a4bf390757 Loading recommendations: If no reference artifact is given use current
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 845
diff changeset
740
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
741 }
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
742
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
743 loadArtifactService.loadMany(
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
744 collection,
8718
e689be2a4dd1 Backout 8716:b5ac17a10d22 Regression risk too high.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8717
diff changeset
745 recommendations,
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
746 null,
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
747 locale,
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
748 new AsyncCallback<Artifact[]>() {
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
749 @Override
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
750 public void onFailure(Throwable caught) {
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
751 GWT.log("Error loading recommendations: " +
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
752 caught.getMessage());
4127
1e9e7b7d9f15 More fixes for #897: missing resource exceptions when handling other exceptions
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
753 SC.warn(FLYS.getExceptionString(messages, caught));
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
754 }
803
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
755
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
756 @Override
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
757 public void onSuccess(Artifact[] artifacts) {
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
758 GWT.log("Loaded artifacts: " + artifacts.length);
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
759 addRecommendationsToCollection();
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
760 }
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
761 });
803
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
762 }
915
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 908
diff changeset
763
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 908
diff changeset
764
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 908
diff changeset
765 public void registerTabHandler(TabSelectedHandler tse) {
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 908
diff changeset
766 tabs.addTabSelectedHandler(tse);
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 908
diff changeset
767 }
2906
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
768
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
769
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
770 public void setCurrentKm(double currentKm) {
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
771 this.currentKm = currentKm;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
772 }
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
773
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
774 public double getCurrentKm() {
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
775 return this.currentKm;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
776 }
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
777
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
778 public void setMinKm(double km) {
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
779 this.minKm = km;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
780 }
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
781
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
782 public double getMinKm() {
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
783 return this.minKm;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
784 }
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
785
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
786 public void setMaxKm(double km) {
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
787 this.maxKm = km;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
788 }
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
789
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
790 public double getMaxKm() {
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
791 return this.maxKm;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
792 }
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
793
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
794 public void setSteps(double step) {
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
795 this.steps = step;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
796 }
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
797
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
798 public double getSteps() {
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
799 return this.steps;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
800 }
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
801 }
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
802 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org