Mercurial > dive4elements > river
annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/BedHeightsDatacagePanel.java @ 8791:22169da49f9b
Remove unused imports.
Found with mvn checkstyle:checkstyle.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 10 Dec 2015 14:40:03 +0100 |
parents | 4c15f98be26c |
children | 8f6d6d26e96f 5e38e2924c07 |
rev | line source |
---|---|
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
9 package org.dive4elements.river.client.client.ui.minfo; |
3508
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 |
3535
75a3a41a6e51
Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3508
diff
changeset
|
11 import com.google.gwt.core.client.GWT; |
4183 | 12 |
7971
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
13 import com.smartgwt.client.util.SC; |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
14 import com.smartgwt.client.widgets.Button; |
3535
75a3a41a6e51
Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3508
diff
changeset
|
15 import com.smartgwt.client.widgets.Canvas; |
4183 | 16 |
3535
75a3a41a6e51
Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3508
diff
changeset
|
17 import com.smartgwt.client.widgets.events.ClickEvent; |
7971
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
18 import com.smartgwt.client.widgets.events.ClickHandler; |
4183 | 19 |
3535
75a3a41a6e51
Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3508
diff
changeset
|
20 import com.smartgwt.client.widgets.layout.VLayout; |
7971
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
21 import com.smartgwt.client.widgets.tree.TreeNode; |
3535
75a3a41a6e51
Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3508
diff
changeset
|
22 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
23 import org.dive4elements.river.client.client.FLYSConstants; |
4183 | 24 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
25 import org.dive4elements.river.client.client.services.LoadArtifactServiceAsync; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
26 import org.dive4elements.river.client.client.services.RemoveArtifactServiceAsync; |
4183 | 27 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
28 import org.dive4elements.river.client.client.ui.DatacageTwinPanel; |
7971
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
29 import org.dive4elements.river.client.client.ui.DatacageWidget; |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
30 import org.dive4elements.river.client.client.ui.RecommendationPairRecord; |
4183 | 31 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
32 import org.dive4elements.river.client.shared.model.DataList; |
7971
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
33 import org.dive4elements.river.client.shared.model.ToLoad; |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
34 |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
35 import org.dive4elements.river.client.shared.model.Recommendation; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
36 import org.dive4elements.river.client.shared.model.User; |
3535
75a3a41a6e51
Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3508
diff
changeset
|
37 |
3508
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 import java.util.ArrayList; |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
39 import java.util.List; |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
40 |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 // TODO Probably better to branch off AbstractUIProvider. |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 public class BedHeightsDatacagePanel |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 extends DatacageTwinPanel { |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
45 protected static FLYSConstants MSG = GWT.create(FLYSConstants.class); |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
47 /** |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
48 * List to track previously selected but now removed pairs. (Needed to |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
49 * be able to identify artifacts that can be removed from the collection. |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 */ |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 protected List<RecommendationPairRecord> removedPairs = |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 new ArrayList<RecommendationPairRecord>(); |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 /** Service handle to clone and add artifacts to collection. */ |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 LoadArtifactServiceAsync loadArtifactService = GWT.create( |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
56 org.dive4elements.river.client.client.services.LoadArtifactService.class); |
3508
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
57 |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
58 /** Service to remove artifacts from collection. */ |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 RemoveArtifactServiceAsync removeArtifactService = GWT.create( |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
60 org.dive4elements.river.client.client.services.RemoveArtifactService.class); |
3508
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
61 |
7971
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
62 protected DatacageWidget datacage; |
3508
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
63 |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
64 public BedHeightsDatacagePanel(User user) { |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
65 super(user); |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
66 } |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
67 |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
68 /** |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
69 * Creates the graphical representation and interaction widgets for the data. |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
70 * @param dataList the data. |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
71 * @return graphical representation and interaction widgets for data. |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
72 */ |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
73 @Override |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
74 public Canvas create(DataList dataList) { |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
75 GWT.log("createData()"); |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
76 |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
77 Canvas widget = createWidget(); |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
78 Canvas submit = getNextButton(); |
7971
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
79 datacage = new DatacageWidget( |
8298
5dfb3ff98bc6
Purge clash of out-names, resulting hacks and tests for not existing outs and give some more meaningful names.
"Tom Gottfried <tom@intevation.de>"
parents:
8023
diff
changeset
|
80 this.artifact, user, "minfo_diff_panel", "load-system:true", false); |
7971
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
81 |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
82 Button plusBtn = new Button(MSG.datacage_add_pair()); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
83 plusBtn.setAutoFit(true); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
84 plusBtn.addClickHandler(new ClickHandler() { |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
85 @Override |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
86 public void onClick(ClickEvent event) { |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
87 plusClicked(); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
88 } |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
89 }); |
3508
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
90 |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
91 VLayout layout = new VLayout(); |
7971
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
92 VLayout helperLayout = new VLayout(); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
93 helperLayout.addMember(datacage); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
94 helperLayout.addMember(plusBtn); |
3508
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
95 |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
96 layout.addMember(widget); |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
97 layout.addMember(submit); |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
98 layout.setMembersMargin(10); |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
99 this.helperContainer.addMember(helperLayout); |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
100 |
8719
36f52c80b7ac
Deduplicate W / BedHeight Difference selection panel code
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8298
diff
changeset
|
101 populateGrid(dataList, "bedheight"); |
3508
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
102 |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
103 return layout; |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
104 } |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
105 |
8719
36f52c80b7ac
Deduplicate W / BedHeight Difference selection panel code
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8298
diff
changeset
|
106 public void adjustRecommendation(Recommendation recommendation) { |
36f52c80b7ac
Deduplicate W / BedHeight Difference selection panel code
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8298
diff
changeset
|
107 recommendation.setFactory("bedheight"); |
3508
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
108 } |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
109 |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
110 @Override |
8719
36f52c80b7ac
Deduplicate W / BedHeight Difference selection panel code
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8298
diff
changeset
|
111 protected String createDataString(String artifact, Recommendation recommendation) { |
36f52c80b7ac
Deduplicate W / BedHeight Difference selection panel code
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8298
diff
changeset
|
112 return createDataString(artifact, recommendation, "bedheight"); |
3508
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
113 } |
7971
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
114 |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
115 /** |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
116 * Callback for add-button. |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
117 * Fires to load for every selected element and handler. |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
118 */ |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
119 public void plusClicked() { |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
120 List<TreeNode> selection = datacage.getPlainSelection(); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
121 |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
122 if (selection == null || selection.isEmpty()) { |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
123 SC.say(MSG.warning()); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
124 return; |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
125 } |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
126 |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
127 for (TreeNode node : selection) { |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
128 ToLoad toLoad1 = new ToLoad(); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
129 ToLoad toLoad2 = new ToLoad(); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
130 |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
131 String factory = node.getAttribute("factory"); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
132 if (factory != null) { // we need at least a factory |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
133 String artifact = node.getAttribute("artifact-id"); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
134 String out = node.getAttribute("out"); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
135 String name = node.getAttribute("facet"); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
136 String ids = node.getAttribute("ids"); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
137 String info = node.getAttribute("info"); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
138 String targetOut = node.getAttribute("target_out"); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
139 |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
140 String[] splitIds = ids.split("#"); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
141 String[] splitInfo = info.split("#"); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
142 toLoad1.add(artifact, |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
143 factory, |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
144 out, |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
145 name, |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
146 splitIds[0], |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
147 splitInfo[0], |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
148 targetOut); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
149 toLoad2.add(artifact, |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
150 factory, |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
151 out, |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
152 name, |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
153 splitIds[1], |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
154 splitInfo[1], |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
155 targetOut); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
156 } |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
157 differencesList.addData(new RecommendationPairRecord( |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
158 toLoad1.toRecommendations().get(0), |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
159 toLoad2.toRecommendations().get(0))); |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
160 } |
93da474506e7
Changed twin dc panel in bed height deifferences to single dc and use the new differences dc macro.
Raimund Renkert <rrenkert@intevation.de>
parents:
7921
diff
changeset
|
161 } |
3508
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
162 } |
60984be9bcfa
MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
163 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |