annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java @ 3501:0de0ef04bcdc

Delete empty project after closing CollectionView (#785). flys-client/trunk@5234 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Christian Lins <christian.lins@intevation.de>
date Wed, 22 Aug 2012 12:29:33 +0000
parents 8bedd1fcaeee
children 6eeacd0bbe26
rev   line source
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
1 package de.intevation.flys.client.client.ui;
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
2
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
3 import com.google.gwt.core.client.GWT;
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
4 import com.google.gwt.user.client.rpc.AsyncCallback;
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
5 import com.smartgwt.client.types.Alignment;
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3347
diff changeset
6 import com.smartgwt.client.types.VerticalAlignment;
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
7 import com.smartgwt.client.util.SC;
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
8 import com.smartgwt.client.widgets.Img;
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
9 import com.smartgwt.client.widgets.Window;
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
10 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
11 import com.smartgwt.client.widgets.events.CloseClickHandler;
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
12 import com.smartgwt.client.widgets.layout.HLayout;
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
13 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
14 import com.smartgwt.client.widgets.layout.VLayout;
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
15 import com.smartgwt.client.widgets.tab.TabSet;
915
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 908
diff changeset
16 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
17
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
18 import de.intevation.flys.client.client.Config;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
19 import de.intevation.flys.client.client.FLYS;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
20 import de.intevation.flys.client.client.FLYSConstants;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
21 import de.intevation.flys.client.client.event.CollectionChangeEvent;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
22 import de.intevation.flys.client.client.event.CollectionChangeHandler;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
23 import de.intevation.flys.client.client.event.HasCollectionChangeHandlers;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
24 import de.intevation.flys.client.client.event.HasOutputModesChangeHandlers;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
25 import de.intevation.flys.client.client.event.OutputModesChangeEvent;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
26 import de.intevation.flys.client.client.event.OutputModesChangeHandler;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
27 import de.intevation.flys.client.client.event.ParameterChangeEvent;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
28 import de.intevation.flys.client.client.event.ParameterChangeHandler;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
29 import de.intevation.flys.client.client.services.AddArtifactService;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
30 import de.intevation.flys.client.client.services.AddArtifactServiceAsync;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
31 import de.intevation.flys.client.client.services.ArtifactService;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
32 import de.intevation.flys.client.client.services.ArtifactServiceAsync;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
33 import de.intevation.flys.client.client.services.CollectionAttributeService;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
34 import de.intevation.flys.client.client.services.CollectionAttributeServiceAsync;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
35 import de.intevation.flys.client.client.services.CreateCollectionService;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
36 import de.intevation.flys.client.client.services.CreateCollectionServiceAsync;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
37 import de.intevation.flys.client.client.services.DescribeCollectionService;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
38 import de.intevation.flys.client.client.services.DescribeCollectionServiceAsync;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
39 import de.intevation.flys.client.client.services.LoadArtifactService;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
40 import de.intevation.flys.client.client.services.LoadArtifactServiceAsync;
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
41 import de.intevation.flys.client.shared.model.Artifact;
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
42 import de.intevation.flys.client.shared.model.ArtifactDescription;
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
43 import de.intevation.flys.client.shared.model.Collection;
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
44 import de.intevation.flys.client.shared.model.ExportMode;
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
45 import de.intevation.flys.client.shared.model.OutputMode;
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
46 import de.intevation.flys.client.shared.model.Recommendation;
593
c0477626ae6a #156 Do not display report modes as tabs in the project view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 582
diff changeset
47 import de.intevation.flys.client.shared.model.ReportMode;
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
48 import de.intevation.flys.client.shared.model.User;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
50 import java.util.ArrayList;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
51 import java.util.HashMap;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
52 import java.util.List;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
53 import java.util.Map;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
54 import java.util.Set;
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
55 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
56
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
57
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
58 /**
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
59 * @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
60 */
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
61 public class CollectionView
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
62 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
63 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
64 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
65 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
66 {
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
67 /** 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
68 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
69 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
70
803
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
71 /** 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
72 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
73 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
74
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
75 /** 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
76 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
77 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
78
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
79 /** 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
80 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
81 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
82
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
83 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
84 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
85
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
86 /** The LoadArtifactService used to load recommendations*/
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
87 protected LoadArtifactServiceAsync loadArtifactService =
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
88 GWT.create(LoadArtifactService.class);
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
89
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
90 /** 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
91 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
92
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
93 /** 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
94 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
95
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
96 /** 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
97 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
98
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
99 /** The list of CollectionChangeHandlers. */
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
100 protected List<CollectionChangeHandler> handlers;
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
101
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
102 /** 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
103 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
104
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
105 /** 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
106 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
107
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
108 /** 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
109 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
110
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 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
112
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
113 /** 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
114 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
115
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
116 /** 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
117 protected Layout layout;
3366
8bedd1fcaeee Removed trailing whitespace. Import cleanup
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3363
diff changeset
118
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
119 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
120
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
121 protected int artifactsQueue;
1512
685bce693617 Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1493
diff changeset
122 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
123 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
124
2906
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
125 /** Values for fix analysis charts*/
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
126 protected double currentKm;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
127 protected double minKm;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
128 protected double maxKm;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
129 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
130
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
131 /**
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
132 * 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
133 * <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
134 */
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
135 public CollectionView(FLYS flys) {
908
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
136 // do this first because it takes longer than the other stuff in here.
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
137 User user = flys.getCurrentUser();
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
138 createNewCollection(user.identifier());
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
139
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
140 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
141 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
142 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
143 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
144 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
145 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
146 this.parameterList = new ParameterList(
92
fa3d9f79dff5 Changed some german strings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 91
diff changeset
147 flys, this, messages.new_project());
3363
8d38a1e097c2 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3353
diff changeset
148 this.artifactsQueue = 0;
1512
685bce693617 Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1493
diff changeset
149 this.recommendationQueue = 0;
3363
8d38a1e097c2 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3353
diff changeset
150 this.newRecommendations = new Stack<Recommendation>();
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
151
2906
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
152 this.currentKm = -1d;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
153 this.minKm = -1d;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
154 this.maxKm = -1d;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
155 this.steps = -1d;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
156
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
157 addCollectionChangeHandler(this);
275
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
158 addCollectionChangeHandler(parameterList);
611
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 601
diff changeset
159 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
160 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
161 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
162 addCloseClickHandler(this);
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
163
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
164 parameterList.addParameterChangeHandler(this);
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
165
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
166 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
167 }
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
168
1557
964e90c5b4c1 Invested 2 seconds after losing 3.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1539
diff changeset
169 /**
964e90c5b4c1 Invested 2 seconds after losing 3.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1539
diff changeset
170 * @param collection The collection to be displayed.
964e90c5b4c1 Invested 2 seconds after losing 3.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1539
diff changeset
171 */
224
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
172 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
173 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
174 this.artifact = artifact;
1b9b7e9ab219 Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 820
diff changeset
175 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
176 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
177 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
178 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
179 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
180 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
181
2906
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
182 this.currentKm = -1d;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
183 this.minKm = -1d;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
184 this.maxKm = -1d;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
185 this.steps = -1d;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
186
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
187 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
188 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
189 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
190 this,
94d4f040da3a Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1270
diff changeset
191 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
192 artifact);
94d4f040da3a Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1270
diff changeset
193 }
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
194 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
195 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
196 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
197 }
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
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
199 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
200 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
201
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
202 addCollectionChangeHandler(this);
275
8264b02091ef ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
203 addCollectionChangeHandler(parameterList);
611
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 601
diff changeset
204 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
205 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
206 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
207 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
208
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
209 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
210
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
211 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
212
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
213 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
214
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
215 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
216 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
217 }
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
218 }
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
219
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
220
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
221 /**
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
222 * 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
223 */
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
224 protected void init() {
3347
6d749af6a9c2 Issue #726 work.
Christian Lins <christian.lins@intevation.de>
parents: 2983
diff changeset
225 setWidth(1010);
6d749af6a9c2 Issue #726 work.
Christian Lins <christian.lins@intevation.de>
parents: 2983
diff changeset
226 setHeight(700);
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
227
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
228 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
229
77
5b5ec0403844 Limited the area for CollectionView to the size of FLYSWorkspace.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 75
diff changeset
230 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
231 setCanDragResize(true);
437
7fa15845fecf ISSUE-35 The project view has a maximize button now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 276
diff changeset
232 setShowMaximizeButton(true);
77
5b5ec0403844 Limited the area for CollectionView to the size of FLYSWorkspace.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 75
diff changeset
233 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
234
84
b8acb6a615f2 Removed the title (date string) of CollectionViews.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
235 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
236
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
237 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
238
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
239 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
240 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
241 }
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
242
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
243
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
244 /**
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
245 * This method triggers the CreateCollectionService to create a new
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
246 * collection in the artifact server.
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
247 *
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
248 * @param ownerId The uuid of the user that should own the new collection.
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
249 */
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
250 protected void createNewCollection(String ownerId) {
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
251 GWT.log("CollectionView.createNewCollection");
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
252
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
253 Config config = Config.getInstance();
924da6695800 Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 228
diff changeset
254 final String locale = config.getLocale();
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
255
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
256 createCollectionService.create(
1425
bc06a671ef60 Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1294
diff changeset
257 locale,
bc06a671ef60 Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1294
diff changeset
258 ownerId,
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
259 new AsyncCallback<Collection>() {
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
260 @Override
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
261 public void onFailure(Throwable caught) {
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 GWT.log("Could not create the new collection.");
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
263 SC.warn(messages.getString(caught.getMessage()));
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
264 }
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
265
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
266 @Override
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
267 public void onSuccess(Collection collection) {
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
268 GWT.log("Successfully created a new collection.");
803
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
269 setCollection(collection);
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
270 }
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
271 });
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
272 }
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
273
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
274
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
275 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
276 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
277 }
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
278
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
279
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
280 /**
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
281 * 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
282 *
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
283 * @param handler The new CollectionChangeHandler.
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
284 */
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
285 @Override
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
286 public void addCollectionChangeHandler(CollectionChangeHandler handler) {
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
287 if (handler != null) {
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
288 handlers.add(handler);
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
289 }
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
290 }
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
291
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
292
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
293 /**
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
294 * 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
295 *
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
296 * @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
297 */
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
298 @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
299 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
300 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
301 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
302 }
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 }
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
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
36
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
306 /**
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
307 * 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
308 * registered ValueChangeHanders.
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
309 */
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
310 protected void fireCollectionChangeEvent(
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
311 Collection old, Collection newCol)
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
312 {
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
313 for (CollectionChangeHandler handler: handlers) {
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
314 handler.onCollectionChange(new CollectionChangeEvent(old, newCol));
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
315 }
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
316 }
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
317
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
318
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
319 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
320 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
321 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
322 }
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
323
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 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
325 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
326 }
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
327 }
3366
8bedd1fcaeee Removed trailing whitespace. Import cleanup
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3363
diff changeset
328
8bedd1fcaeee Removed trailing whitespace. Import cleanup
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3363
diff changeset
329
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
330 public void lockUI() {
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3347
diff changeset
331 if (lockScreen == null) {
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3347
diff changeset
332 lockScreen = new VLayout();
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3347
diff changeset
333 lockScreen.setWidth100();
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3347
diff changeset
334 lockScreen.setHeight100();
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3347
diff changeset
335 lockScreen.setBackgroundColor("#7f7f7f");
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3347
diff changeset
336 lockScreen.setOpacity(50);
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3347
diff changeset
337 lockScreen.setAlign(VerticalAlignment.CENTER);
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3347
diff changeset
338 lockScreen.setDefaultLayoutAlign(VerticalAlignment.CENTER);
3366
8bedd1fcaeee Removed trailing whitespace. Import cleanup
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3363
diff changeset
339
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
340 HLayout inner = new HLayout();
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3347
diff changeset
341 inner.setAlign(Alignment.CENTER);
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3347
diff changeset
342 inner.setDefaultLayoutAlign(Alignment.CENTER);
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3347
diff changeset
343 inner.setOpacity(100);
3366
8bedd1fcaeee Removed trailing whitespace. Import cleanup
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3363
diff changeset
344
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
345 Img img = new Img(
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3347
diff changeset
346 GWT.getHostPageBaseURL() + messages.loadingImg(),
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3347
diff changeset
347 25, 25);
3366
8bedd1fcaeee Removed trailing whitespace. Import cleanup
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3363
diff changeset
348
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
349 inner.addMember(img);
3366
8bedd1fcaeee Removed trailing whitespace. Import cleanup
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3363
diff changeset
350
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
351 lockScreen.addMember(inner);
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3347
diff changeset
352 }
3366
8bedd1fcaeee Removed trailing whitespace. Import cleanup
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3363
diff changeset
353
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
354 layout.addChild(lockScreen);
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3347
diff changeset
355 }
3366
8bedd1fcaeee Removed trailing whitespace. Import cleanup
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3363
diff changeset
356
8bedd1fcaeee Removed trailing whitespace. Import cleanup
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3363
diff changeset
357
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
358 public void unlockUI() {
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3347
diff changeset
359 layout.removeChild(lockScreen);
08f8524a81ad Lock the screen when the parameterization of a Collection's master Artifact changes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3347
diff changeset
360 }
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
361
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
362
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
363 /**
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
364 * 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
365 * 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
366 *
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
367 * @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
368 */
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
369 public boolean isNew() {
582
78907f0fb939 Added dummy report panel.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 557
diff changeset
370 return collection.getItemLength() == 0;
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
371 }
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
372
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
373
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
374 /**
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
375 * 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
376 *
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
377 * @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
378 */
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
379 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
380 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
381 }
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
382
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 862
diff changeset
383
811
8fa303586f14 Pass user id to the meta data service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 809
diff changeset
384 public User getUser() {
8fa303586f14 Pass user id to the meta data service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 809
diff changeset
385 return getFlys().getCurrentUser();
8fa303586f14 Pass user id to the meta data service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 809
diff changeset
386 }
8fa303586f14 Pass user id to the meta data service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 809
diff changeset
387
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
388
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
389 /**
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
390 * 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
391 *
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
392 * @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
393 */
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
394 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
395 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
396
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
397 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
398 }
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
399
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
400
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
401 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: 1261
diff changeset
402 artifactChanged();
ea9a73782de4 Bugfix: #321 Refresh the parameter list after a calculation is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1261
diff changeset
403
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
404 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
405 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
406 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
407 }
36
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
408 }
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
409
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
410
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
411 /**
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
412 * 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
413 * parameterization has changed.
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
414 *
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
415 * @param event The ParameterChangeEvent.
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
416 */
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
417 @Override
36
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
418 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
419 GWT.log("CollectionView.onParameterChange");
1270
ea9a73782de4 Bugfix: #321 Refresh the parameter list after a calculation is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1261
diff changeset
420 setArtifact(event.getNewValue());
ea9a73782de4 Bugfix: #321 Refresh the parameter list after a calculation is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1261
diff changeset
421 }
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
422
1270
ea9a73782de4 Bugfix: #321 Refresh the parameter list after a calculation is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1261
diff changeset
423
ea9a73782de4 Bugfix: #321 Refresh the parameter list after a calculation is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1261
diff changeset
424 protected void artifactChanged() {
ea9a73782de4 Bugfix: #321 Refresh the parameter list after a calculation is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1261
diff changeset
425 ArtifactDescription desc = getArtifact().getArtifactDescription();
3347
6d749af6a9c2 Issue #726 work.
Christian Lins <christian.lins@intevation.de>
parents: 2983
diff changeset
426 //OutputMode[] outs = desc.getOutputModes();
3363
8d38a1e097c2 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3353
diff changeset
427 final Recommendation[] recom = desc.getRecommendations();
803
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
428
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
429 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
430
908
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
431 if (c != null) {
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
432 Config config = Config.getInstance();
229
924da6695800 Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 228
diff changeset
433 String locale = config.getLocale();
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
434
1425
bc06a671ef60 Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1294
diff changeset
435 describeCollectionService.describe(c.identifier(), locale,
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
436 new AsyncCallback<Collection>() {
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
437 @Override
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
438 public void onFailure(Throwable caught) {
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
439 GWT.log("Could not DESCRIBE collection.");
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
440 SC.warn(messages.getString(caught.getMessage()));
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
441 }
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
442
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
443
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
444 @Override
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
445 public void onSuccess(Collection newCollection) {
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
446 GWT.log("Successfully DESCRIBED collection.");
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
447 boolean loaded = true;
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
448 for (Recommendation r: recom) {
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
449 if(!newCollection.loadedRecommendation(r)) {
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
450 loaded = false;
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
451 }
1512
685bce693617 Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1493
diff changeset
452 }
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
453 if (!loaded) {
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
454 loadRecommendedArtifacts(recom);
1512
685bce693617 Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1493
diff changeset
455 }
1525
27a2a065a963 Set the collection if all recommended artifacts are loaded or the
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1515
diff changeset
456 else {
27a2a065a963 Set the collection if all recommended artifacts are loaded or the
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1515
diff changeset
457 setCollection(newCollection);
27a2a065a963 Set the collection if all recommended artifacts are loaded or the
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1515
diff changeset
458 }
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
459 }
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
460 }
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
461 );
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
462 }
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
463 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
464 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
465 }
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
466 }
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
467
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
468
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
469 /**
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
470 * 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
471 *
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
472 * @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
473 */
537
d2c37ba78feb The collection object in the CollectionView is now accessible via getter method.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 521
diff changeset
474 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
475 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
476 }
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
477
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
478
908
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
479 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
480 setCollection(collection, false);
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
481 }
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
482
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
483
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
484 /**
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
485 * 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
486 *
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
487 * @param collection The new collection.
1557
964e90c5b4c1 Invested 2 seconds after losing 3.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1539
diff changeset
488 * @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
489 */
908
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
490 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
491 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
492 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
493 }
3cf6ee30207c Register newly created CollectionViews at FLYSWorkspace to avoid an inconsistent view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 593
diff changeset
494
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
495 Collection tmp = this.collection;
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
496 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
497
2437
18478c9baa67 Removed the Collection's UUID from CollectionView's title.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1619
diff changeset
498 setTitle(collection.getName());
908
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
499
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
500 if (!suppress) {
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
501 fireCollectionChangeEvent(tmp, this.collection);
a680ccec5dd6 Create new collections initially when starting a new project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
502 }
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
503 }
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
504
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
505
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
506 @Override
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
507 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
508 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
509 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
510 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
511 }
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
512
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
513 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
514
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
515 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
516
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
517 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
518 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
519
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
520 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
521 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
522 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
523 }
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
524
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 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
526
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
527 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
528 }
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
529
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
530
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
531 @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
532 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
533 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
534 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
535
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
536 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
537 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
538 }
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
539
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
540 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
541
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
542 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
543 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
544
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
545 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
546 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
547
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
548 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
549 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
550 }
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
551 }
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
552 }
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
553
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
554 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
555 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
556 }
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
557 }
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
558
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
559
36
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
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 * 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
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 * @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
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 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
566 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
567 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
568
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
569 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
570 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
571 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
572 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
573 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
574 }
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
575
239
47fe77a1bac7 Added new i18n strings for new output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
576 return;
47fe77a1bac7 Added new i18n strings for new output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
577 }
47fe77a1bac7 Added new i18n strings for new output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
578
593
c0477626ae6a #156 Do not display report modes as tabs in the project view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 582
diff changeset
579 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
580 // 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
581 return;
c0477626ae6a #156 Do not display report modes as tabs in the project view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 582
diff changeset
582 }
c0477626ae6a #156 Do not display report modes as tabs in the project view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 582
diff changeset
583
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
584 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
585
796
cd8603aaa730 Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
586 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
587 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
588
cd8603aaa730 Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
589 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
590 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
591 }
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
592 }
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
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
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 /**
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 * 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
597 */
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 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
599 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
600
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
601 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
602
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
603 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
604 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
605 }
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
606
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
607 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
608 }
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
609
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
610
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
611 /**
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
612 * 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
613 */
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
614 protected void updateView() {
36
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
615 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
616 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
617 }
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
618
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
619
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
620 /**
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
621 * 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
622 */
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
623 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
624 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
625 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
626 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
627
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
628 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
629 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
630 }
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
631 }
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
632 }
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
633
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
634
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
635 @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
636 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
637 if (collection != null) {
3501
0de0ef04bcdc Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
638 if(artifact != null) {
0de0ef04bcdc Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
639 flys.closeProject(collection.identifier());
0de0ef04bcdc Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
640 }
0de0ef04bcdc Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
641 else {
0de0ef04bcdc Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
642 flys.getProjectList().deleteCollection(collection);
0de0ef04bcdc Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
643 }
611
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 601
diff changeset
644 }
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 601
diff changeset
645 else {
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 601
diff changeset
646 hide();
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 601
diff changeset
647 destroy();
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 601
diff changeset
648 }
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
649 }
803
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
650
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
651
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
652 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
653 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
654 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
655 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
656
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
657 addArtifactService.add(
1425
bc06a671ef60 Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1294
diff changeset
658 collection, artifact, locale,
803
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
659 new AsyncCallback<Collection>() {
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
660 @Override
803
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
661 public void onFailure(Throwable caught) {
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
662 GWT.log("An error occured while adding artifact.");
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
663 SC.warn(messages.getString(caught.getMessage()));
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
664 }
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
665
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
666 @Override
803
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
667 public void onSuccess(Collection newCollection) {
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
668 GWT.log("Successfully added artifacts.");
1539
28e514c968d6 Suppress onCollectionChange event if an artifact is added to the collection
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1525
diff changeset
669 setCollection(newCollection, true);
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
670 }
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
671 }
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
672 );
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
673 }
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
674
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
675
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
676 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
677 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
678 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
679 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
680
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
681 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
682
1425
bc06a671ef60 Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1294
diff changeset
683 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
684 new AsyncCallback<Collection>() {
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
685 @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
686 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
687 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
688 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
689
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 GWT.log("An error occured while saving 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
691 // TODO POPUP WARNING
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
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
694 @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
695 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
696 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
697 newRecommendations.removeAllElements();
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
698 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
699 }
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
700 }
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
701 );
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
702 }
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
703
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
704
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
705 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
706 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
707 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
708 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
709
847
25a4bf390757 Loading recommendations: If no reference artifact is given use current
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 845
diff changeset
710 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
711
819
11fd6557d0fc UI: Cosmetics in log messages of CollectionView.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 811
diff changeset
712 if (recommendations == null) {
11fd6557d0fc UI: Cosmetics in log messages of CollectionView.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 811
diff changeset
713 GWT.log("WARNING: Currently no recommendations.");
11fd6557d0fc UI: Cosmetics in log messages of CollectionView.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 811
diff changeset
714 return;
11fd6557d0fc UI: Cosmetics in log messages of CollectionView.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 811
diff changeset
715 }
11fd6557d0fc UI: Cosmetics in log messages of CollectionView.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 811
diff changeset
716
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
717 for (final Recommendation recommendation: 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
718 if (collection.loadedRecommendation(recommendation)) {
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
719 continue;
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
720 }
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
721 newRecommendations.push(recommendation);
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
722
847
25a4bf390757 Loading recommendations: If no reference artifact is given use current
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 845
diff changeset
723 // 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
724 // 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
725 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
726 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
727 }
25a4bf390757 Loading recommendations: If no reference artifact is given use current
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 845
diff changeset
728
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
729 }
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
730
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
731 loadArtifactService.loadMany(
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
732 collection,
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
733 recommendations,
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
734 null,
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
735 locale,
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
736 new AsyncCallback<Artifact[]>() {
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
737 @Override
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
738 public void onFailure(Throwable caught) {
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
739 GWT.log("Error loading recommendations: " +
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
740 caught.getMessage());
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
741 }
803
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
742
2983
725470fc57d2 Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents: 2906
diff changeset
743 @Override
1515
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
744 public void onSuccess(Artifact[] artifacts) {
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
745 GWT.log("Loaded artifacts: " + artifacts.length);
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
746 addRecommendationsToCollection();
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
747 }
298a4ce64c2e Issue451.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1512
diff changeset
748 });
803
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 796
diff changeset
749 }
915
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 908
diff changeset
750
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 908
diff changeset
751
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 908
diff changeset
752 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
753 tabs.addTabSelectedHandler(tse);
89a47098bcbd Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 908
diff changeset
754 }
2906
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
755
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
756
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
757 public void setCurrentKm(double currentKm) {
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
758 this.currentKm = currentKm;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
759 }
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
760
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
761 public double getCurrentKm() {
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
762 return this.currentKm;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
763 }
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
764
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
765 public void setMinKm(double km) {
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
766 this.minKm = km;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
767 }
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 public double getMinKm() {
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
770 return this.minKm;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
771 }
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 public void setMaxKm(double km) {
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
774 this.maxKm = km;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
775 }
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 public double getMaxKm() {
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
778 return this.maxKm;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
779 }
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 public void setSteps(double step) {
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
782 this.steps = step;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
783 }
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 public double getSteps() {
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
786 return this.steps;
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2905
diff changeset
787 }
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
788 }
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
789 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org