annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/BedHeightsDatacagePanel.java @ 8856:5e38e2924c07 3.2.x

Fix code style.
author Tom Gottfried <tom@intevation.de>
date Thu, 18 Jan 2018 20:12:01 +0100
parents 22169da49f9b
children 28df64078f27
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
Christian Lins <christian.lins@intevation.de>
parents: 4182
diff changeset
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
Christian Lins <christian.lins@intevation.de>
parents: 4182
diff changeset
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
Christian Lins <christian.lins@intevation.de>
parents: 4182
diff changeset
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
Christian Lins <christian.lins@intevation.de>
parents: 4182
diff changeset
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
Christian Lins <christian.lins@intevation.de>
parents: 4182
diff changeset
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
Christian Lins <christian.lins@intevation.de>
parents: 4182
diff changeset
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(
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8791
diff changeset
56 org.dive4elements.river.client.client.services
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8791
diff changeset
57 .LoadArtifactService.class);
3508
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
58
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
59 /** Service to remove artifacts from collection. */
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60 RemoveArtifactServiceAsync removeArtifactService = GWT.create(
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8791
diff changeset
61 org.dive4elements.river.client.client.services
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8791
diff changeset
62 .RemoveArtifactService.class);
3508
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63
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
64 protected DatacageWidget datacage;
3508
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 public BedHeightsDatacagePanel(User user) {
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
67 super(user);
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
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70 /**
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8791
diff changeset
71 * Creates graphical representation and interaction widgets for the data.
3508
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
72 * @param dataList the data.
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
73 * @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
74 */
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
75 @Override
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
76 public Canvas create(DataList dataList) {
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
77 GWT.log("createData()");
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
78
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
79 Canvas widget = createWidget();
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
80 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
81 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
82 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
83
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 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
85 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
86 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
87 @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
88 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
89 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
90 }
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
91 });
3508
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
92
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
93 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
94 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
95 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
96 helperLayout.addMember(plusBtn);
3508
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
97
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
98 layout.addMember(widget);
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
99 layout.addMember(submit);
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
100 layout.setMembersMargin(10);
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
101 this.helperContainer.addMember(helperLayout);
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
102
8719
36f52c80b7ac Deduplicate W / BedHeight Difference selection panel code
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8298
diff changeset
103 populateGrid(dataList, "bedheight");
3508
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 return layout;
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
106 }
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
107
8719
36f52c80b7ac Deduplicate W / BedHeight Difference selection panel code
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8298
diff changeset
108 public void adjustRecommendation(Recommendation recommendation) {
36f52c80b7ac Deduplicate W / BedHeight Difference selection panel code
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8298
diff changeset
109 recommendation.setFactory("bedheight");
3508
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
110 }
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
111
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
112 @Override
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8791
diff changeset
113 protected String createDataString(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8791
diff changeset
114 String artifact,
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8791
diff changeset
115 Recommendation recommendation
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8791
diff changeset
116 ) {
8719
36f52c80b7ac Deduplicate W / BedHeight Difference selection panel code
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8298
diff changeset
117 return createDataString(artifact, recommendation, "bedheight");
3508
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
118 }
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
119
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 /**
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 * 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
122 * 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
123 */
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 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
125 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
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 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
128 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
129 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
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
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 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
133 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
134 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
135
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 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
137 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
138 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
139 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
140 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
141 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
142 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
143 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
144
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 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
146 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
147 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
148 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
149 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
150 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
151 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
152 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
153 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
154 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
155 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
156 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
157 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
158 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
159 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
160 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
161 }
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
162 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
163 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
164 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
165 }
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
166 }
3508
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
167 }
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
168 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org