Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/LoadingPanel.java @ 5486:b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 28 Mar 2013 09:24:41 +0100 |
parents | 360e22afb98b |
children |
rev | line source |
---|---|
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
|
1 package de.intevation.flys.client.client.ui; |
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
|
2 |
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
|
3 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
|
4 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
|
5 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
|
6 |
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
|
7 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
|
8 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
|
9 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
|
10 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
|
11 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
|
12 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
|
13 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
|
14 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
|
15 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
|
16 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
|
17 |
865
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
18 import de.intevation.flys.client.client.Config; |
878
d7c322a3bb32
Introduced i18n for the loading panel used during floodmap calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
870
diff
changeset
|
19 import de.intevation.flys.client.client.FLYSConstants; |
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
|
20 import de.intevation.flys.client.client.event.HasStepBackHandlers; |
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 de.intevation.flys.client.client.event.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
|
22 import de.intevation.flys.client.client.event.StepBackHandler; |
865
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
23 import de.intevation.flys.client.client.services.DescribeArtifactService; |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
24 import de.intevation.flys.client.client.services.DescribeArtifactServiceAsync; |
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 import de.intevation.flys.client.shared.model.Artifact; |
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
|
26 import de.intevation.flys.client.shared.model.ArtifactDescription; |
870
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
865
diff
changeset
|
27 import de.intevation.flys.client.shared.model.CalculationMessage; |
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
|
28 import de.intevation.flys.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
|
29 |
4131
360e22afb98b
Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents:
1432
diff
changeset
|
30 import java.util.ArrayList; |
360e22afb98b
Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents:
1432
diff
changeset
|
31 import java.util.List; |
360e22afb98b
Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents:
1432
diff
changeset
|
32 |
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
|
33 |
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
|
34 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
|
35 |
4131
360e22afb98b
Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents:
1432
diff
changeset
|
36 private static final long serialVersionUID = -7806425431408987601L; |
360e22afb98b
Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents:
1432
diff
changeset
|
37 |
870
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
865
diff
changeset
|
38 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
|
39 |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
40 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
|
41 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
|
42 |
878
d7c322a3bb32
Introduced i18n for the loading panel used during floodmap calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
870
diff
changeset
|
43 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
|
44 |
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
|
45 |
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
|
46 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
|
47 |
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
|
48 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
|
49 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
|
50 |
870
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
865
diff
changeset
|
51 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
|
52 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
|
53 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
|
54 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
|
55 |
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 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
|
57 |
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 |
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
|
59 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
|
60 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
|
61 |
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
|
62 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
|
63 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
|
64 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
|
65 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
|
66 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
|
67 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
|
68 |
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 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
|
70 |
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 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
|
72 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
|
73 } |
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
|
74 |
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 |
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 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
|
77 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
|
78 setHeight("98%"); |
898
a9dd792444a1
Changed style for loading panel.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
878
diff
changeset
|
79 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
|
80 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
|
81 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
|
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 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
|
84 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
|
85 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
|
86 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
|
87 } |
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 |
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 |
865
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
90 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
|
91 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
|
92 } |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
93 |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
94 |
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
|
95 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
|
96 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
|
97 } |
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
|
98 |
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
|
99 |
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
|
100 @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
|
101 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
|
102 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
|
103 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
|
104 } |
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 /** |
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 * 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
|
110 * 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
|
111 * |
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 * @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
|
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 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
|
115 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
|
116 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
|
117 } |
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 } |
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 |
870
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
865
diff
changeset
|
121 protected VLayout createDialog() { |
1399 | 122 |
123 String baseUrl = GWT.getHostPageBaseURL(); | |
124 | |
870
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
865
diff
changeset
|
125 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
|
126 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
|
127 title.setWidth100(); |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
865
diff
changeset
|
128 |
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
|
129 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
|
130 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
|
131 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
|
132 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
|
133 |
1399 | 134 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
|
135 |
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
|
136 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
|
137 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
|
138 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
|
139 @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
|
140 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
|
141 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
|
142 } |
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
|
143 }); |
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 |
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 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
|
146 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
|
147 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
|
148 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
|
149 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
|
150 |
870
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
865
diff
changeset
|
151 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
|
152 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
|
153 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
|
154 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
|
155 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
|
156 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
|
157 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
|
158 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
|
159 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
|
160 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
|
161 |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
865
diff
changeset
|
162 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
|
163 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
|
164 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
|
165 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
|
166 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
|
167 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
|
168 |
870
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
865
diff
changeset
|
169 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
|
170 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
|
171 |
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 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
|
173 } |
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
|
174 |
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 |
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
|
176 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
|
177 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
|
178 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
|
179 |
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
|
180 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
|
181 } |
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
|
182 |
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
|
183 |
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
|
184 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
|
185 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
|
186 @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
|
187 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
|
188 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
|
189 } |
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
|
190 }; |
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
|
191 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
|
192 } |
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 |
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 |
865
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
195 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
|
196 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
|
197 |
865
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
198 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
|
199 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
|
200 |
1425
bc06a671ef60
Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1401
diff
changeset
|
201 describe.describe(locale, artifact, new AsyncCallback<Artifact>() { |
4131
360e22afb98b
Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents:
1432
diff
changeset
|
202 @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
|
203 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
|
204 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
|
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 startTimer(); |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
207 } |
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 |
4131
360e22afb98b
Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents:
1432
diff
changeset
|
209 @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
|
210 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
|
211 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
|
212 |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
213 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
|
214 |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
215 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
|
216 startTimer(); |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
217 } |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
218 else { |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
219 finish(); |
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 } |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
222 }); |
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
|
223 } |
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
|
224 |
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
|
225 |
870
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
865
diff
changeset
|
226 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
|
227 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
|
228 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
|
229 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
|
230 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
|
231 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
|
232 } |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
865
diff
changeset
|
233 else { |
878
d7c322a3bb32
Introduced i18n for the loading panel used during floodmap calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
870
diff
changeset
|
234 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
|
235 } |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
865
diff
changeset
|
236 } |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
865
diff
changeset
|
237 |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
865
diff
changeset
|
238 |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
865
diff
changeset
|
239 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
|
240 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
|
241 } |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
865
diff
changeset
|
242 |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
865
diff
changeset
|
243 |
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
|
244 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
|
245 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
|
246 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
|
247 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
|
248 } |
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
|
249 |
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
|
250 |
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
|
251 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
|
252 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
|
253 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
|
254 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
|
255 } |
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
|
256 } |
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
|
257 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |