annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/LoadingPanel.java @ 5861:172338b1407f

GWT client: Added copyright header.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sun, 28 Apr 2013 14:30:15 +0200
parents 5aa05a7a34b7
children ea9eef426962
rev   line source
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
6 * documentation coming with Dive4Elements River for details.
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
9 package org.dive4elements.river.client.client.ui;
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import com.google.gwt.core.client.GWT;
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import com.google.gwt.user.client.Timer;
865
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
13 import com.google.gwt.user.client.rpc.AsyncCallback;
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 import com.smartgwt.client.types.Alignment;
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 import com.smartgwt.client.types.Positioning;
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
17 import com.smartgwt.client.types.VerticalAlignment;
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 import com.smartgwt.client.widgets.Canvas;
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
19 import com.smartgwt.client.widgets.Img;
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 import com.smartgwt.client.widgets.Label;
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
21 import com.smartgwt.client.widgets.events.ClickEvent;
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
22 import com.smartgwt.client.widgets.events.ClickHandler;
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
23 import com.smartgwt.client.widgets.layout.HLayout;
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
24 import com.smartgwt.client.widgets.layout.VLayout;
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
26 import org.dive4elements.river.client.client.Config;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
27 import org.dive4elements.river.client.client.FLYSConstants;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
28 import org.dive4elements.river.client.client.event.HasStepBackHandlers;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
29 import org.dive4elements.river.client.client.event.StepBackEvent;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
30 import org.dive4elements.river.client.client.event.StepBackHandler;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
31 import org.dive4elements.river.client.client.services.DescribeArtifactService;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
32 import org.dive4elements.river.client.client.services.DescribeArtifactServiceAsync;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
33 import org.dive4elements.river.client.shared.model.Artifact;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
34 import org.dive4elements.river.client.shared.model.ArtifactDescription;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
35 import org.dive4elements.river.client.shared.model.CalculationMessage;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
36 import org.dive4elements.river.client.shared.model.DataList;
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 1432
diff changeset
38 import java.util.ArrayList;
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 1432
diff changeset
39 import java.util.List;
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 1432
diff changeset
40
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41
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
42 public class LoadingPanel extends Canvas implements HasStepBackHandlers {
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 1432
diff changeset
44 private static final long serialVersionUID = -7806425431408987601L;
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 1432
diff changeset
45
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
46 public static final int UPDATE_INTERVAL = 1000 * 3;
865
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
47
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
48 public static final DescribeArtifactServiceAsync describe =
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
49 GWT.create(DescribeArtifactService.class);
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
50
878
d7c322a3bb32 Introduced i18n for the loading panel used during floodmap calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 870
diff changeset
51 private FLYSConstants MSG = GWT.create(FLYSConstants.class);
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
52
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53
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
54 protected List<StepBackHandler> handlers;
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
55
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56 protected CollectionView parent;
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57 protected Artifact artifact;
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
59 protected VLayout dialog;
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
60 protected HLayout cancelRow;
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61 protected Label msg;
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
62 protected Label title;
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64 protected int i;
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67 public LoadingPanel(CollectionView parent, Artifact artifact) {
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68 super();
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69
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
70 this.handlers = new ArrayList<StepBackHandler>();
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 this.parent = parent;
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 this.artifact = artifact;
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
73 this.msg = new Label("");
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
74 this.title = new Label("");
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 this.dialog = createDialog();
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77 this.i = 0;
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 initLayout();
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 startTimer();
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81 }
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84 private void initLayout() {
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85 setWidth("100%");
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86 setHeight("98%");
898
a9dd792444a1 Changed style for loading panel.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 878
diff changeset
87 setBackgroundColor("#7f7f7f");
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88 setOpacity(50);
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
89 setPosition(Positioning.RELATIVE);
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
90
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91 parent.addChild(this);
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92 parent.addChild(dialog);
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
93 dialog.moveTo(0, 20);
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
94 moveTo(0, 7);
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
95 }
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
96
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
97
865
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
98 public void setArtifact(Artifact artifact) {
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
99 this.artifact = artifact;
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
100 }
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
101
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
102
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
103 public Artifact getArtifact() {
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
104 return 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
105 }
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
106
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
107
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
108 @Override
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
109 public void addStepBackHandler(StepBackHandler handler) {
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
110 if (handler != null) {
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
111 handlers.add(handler);
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
112 }
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
113 }
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
114
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
115
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
116 /**
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
117 * This method is called after the user has clicked the button to cancel the
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
118 * current process.
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
119 *
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
120 * @param e The StepBackEvent.
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
121 */
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
122 protected void fireStepBackEvent(StepBackEvent e) {
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
123 for (StepBackHandler handler: handlers) {
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
124 handler.onStepBack(e);
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
125 }
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
126 }
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
127
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
128
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
129 protected VLayout createDialog() {
1399
748e7c828d03 Issue312.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1270
diff changeset
130
748e7c828d03 Issue312.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1270
diff changeset
131 String baseUrl = GWT.getHostPageBaseURL();
748e7c828d03 Issue312.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1270
diff changeset
132
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
133 title.setStyleName("loading-title");
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
134 title.setHeight(25);
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
135 title.setWidth100();
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
136
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
137 msg.setStyleName("loading-message");
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
138 msg.setValign(VerticalAlignment.TOP);
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
139 msg.setWidth100();
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
140 msg.setHeight(100);
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
141
1399
748e7c828d03 Issue312.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1270
diff changeset
142 Img img = new Img(baseUrl + MSG.loadingImg(), 25, 25);
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
143
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
144 Label cancelLabel = new Label(MSG.cancelCalculationLabel());
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
145 Img cancel = new Img(baseUrl + MSG.cancelCalculation(), 25, 25);
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
146 cancel.addClickHandler(new ClickHandler() {
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
147 @Override
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
148 public void onClick(ClickEvent e) {
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
149 cancel();
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
150 }
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
151 });
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
152
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
153 cancelRow = new HLayout();
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
154 cancelRow.setHeight(27);
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
155 cancelRow.setWidth100();
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
156 cancelRow.addMember(cancel);
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
157 cancelRow.addMember(cancelLabel);
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
158
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
159 VLayout box = new VLayout();
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
160 box.setStyleName("loading-box");
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
161 box.setAlign(VerticalAlignment.TOP);
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
162 box.setDefaultLayoutAlign(VerticalAlignment.TOP);
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
163 box.addMember(title);
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
164 box.addMember(msg);
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
165 box.addMember(cancelRow);
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
166 box.setMembersMargin(0);
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
167 box.setHeight(125);
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
168 box.setWidth(275);
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
169
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
170 dialog = new VLayout();
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
171 dialog.setAlign(Alignment.CENTER);
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
172 dialog.setDefaultLayoutAlign(Alignment.CENTER);
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
173 dialog.setMembersMargin(5);
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
174 dialog.setHeight100();
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
175 dialog.setWidth100();
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
176
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
177 dialog.addMember(img);
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
178 dialog.addMember(box);
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
179
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
180 return dialog;
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
181 }
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
182
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
183
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
184 public String getTargetState() {
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
185 ArtifactDescription desc = getArtifact().getArtifactDescription();
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
186 DataList[] oldData = desc.getOldData();
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
187
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
188 return oldData[oldData.length -1].getState();
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
189 }
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
190
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
191
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
192 private void startTimer() {
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
193 Timer t = new Timer() {
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
194 @Override
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
195 public void run() {
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
196 update();
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
197 }
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
198 };
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
199 t.schedule(UPDATE_INTERVAL);
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
200 }
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
201
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
202
865
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
203 protected void update() {
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
204 updateMessage();
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
205
865
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
206 final Config config = Config.getInstance();
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
207 final String locale = config.getLocale();
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
208
1425
bc06a671ef60 Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
209 describe.describe(locale, artifact, new AsyncCallback<Artifact>() {
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 1432
diff changeset
210 @Override
865
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
211 public void onFailure(Throwable t) {
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
212 GWT.log("Error while DESCRIBE artifact: " + t.getMessage());
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
213
865
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
214 startTimer();
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
215 }
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
216
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 1432
diff changeset
217 @Override
865
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
218 public void onSuccess(Artifact artifact) {
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
219 GWT.log("Successfully DESCRIBE artifact.");
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
220
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
221 setArtifact(artifact);
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
222
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
223 if (artifact.isInBackground()) {
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
224 startTimer();
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
225 }
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
226 else {
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
227 finish();
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
228 }
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
229 }
43f520f923a8 Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 862
diff changeset
230 });
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
231 }
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
232
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
233
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
234 protected void updateMessage() {
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
235 List<CalculationMessage> messages = artifact.getBackgroundMessages();
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
236 if (messages != null && messages.size() > 0) {
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
237 CalculationMessage calcMsg = messages.get(0);
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
238 title.setContents(getStepTitle(calcMsg));
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
239 msg.setContents(calcMsg.getMessage());
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
240 }
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
241 else {
878
d7c322a3bb32 Introduced i18n for the loading panel used during floodmap calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 870
diff changeset
242 title.setContents(MSG.calculationStarted());
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
243 }
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
244 }
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
245
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
246
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
247 protected String getStepTitle(CalculationMessage msg) {
878
d7c322a3bb32 Introduced i18n for the loading panel used during floodmap calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 870
diff changeset
248 return MSG.step() + " " + msg.getCurrentStep() + "/" + msg.getSteps();
870
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
249 }
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
250
d5fb88ba99d2 Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 865
diff changeset
251
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
252 private void cancel() {
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
253 fireStepBackEvent(new StepBackEvent(getTargetState()));
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
254 parent.removeChild(dialog);
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
255 parent.removeChild(this);
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
256 }
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
257
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
258
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
259 private void finish() {
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
260 parent.removeChild(dialog);
862
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
261 parent.removeChild(this);
1270
ea9a73782de4 Bugfix: #321 Refresh the parameter list after a calculation is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 898
diff changeset
262 parent.setArtifact(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:
diff changeset
263 }
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
264 }
c9549074ecd1 Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
265 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org