annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/BedHeightsDatacagePanel.java @ 8734:4c15f98be26c

Removed obsolete imports.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 30 Apr 2015 20:02:30 +0200
parents 36f52c80b7ac
children 22169da49f9b
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.LoadArtifactService;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
26 import org.dive4elements.river.client.client.services.LoadArtifactServiceAsync;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
27 import org.dive4elements.river.client.client.services.RemoveArtifactService;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
28 import org.dive4elements.river.client.client.services.RemoveArtifactServiceAsync;
4183
Christian Lins <christian.lins@intevation.de>
parents: 4182
diff changeset
29
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
30 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
31 import org.dive4elements.river.client.client.ui.DatacageWidget;
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
32 import org.dive4elements.river.client.client.ui.RecommendationPairRecord;
4183
Christian Lins <christian.lins@intevation.de>
parents: 4182
diff changeset
33
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
34 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
35 import org.dive4elements.river.client.shared.model.ToLoad;
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
36
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
37 import org.dive4elements.river.client.shared.model.Recommendation;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
38 import org.dive4elements.river.client.shared.model.User;
3535
75a3a41a6e51 Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3508
diff changeset
39
3508
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
40 import java.util.ArrayList;
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
41 import java.util.List;
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
42
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
43 // TODO Probably better to branch off AbstractUIProvider.
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
44 public class BedHeightsDatacagePanel
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
45 extends DatacageTwinPanel {
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 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
48
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 /**
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 * 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
51 * 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
52 */
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53 protected List<RecommendationPairRecord> removedPairs =
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
54 new ArrayList<RecommendationPairRecord>();
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
55
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56 /** 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
57 LoadArtifactServiceAsync loadArtifactService = GWT.create(
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
58 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
59
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60 /** Service to remove artifacts from collection. */
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61 RemoveArtifactServiceAsync removeArtifactService = GWT.create(
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
62 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
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 /**
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
71 * 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
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
8719
36f52c80b7ac Deduplicate W / BedHeight Difference selection panel code
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8298
diff changeset
113 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
114 return createDataString(artifact, recommendation, "bedheight");
3508
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
115 }
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
116
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 /**
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 * 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
119 * 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
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 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
122 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
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 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
125 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
126 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
127 }
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
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 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
130 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
131 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
132
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 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
134 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
135 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
136 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
137 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
138 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
139 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
140 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
141
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[] 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
143 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
144 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
145 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
146 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
147 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
148 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
149 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
150 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
151 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
152 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
153 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
154 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
155 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
156 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
157 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
158 }
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 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
160 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
161 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
162 }
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 }
3508
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
164 }
60984be9bcfa MINFO: Added UI for minfo differences calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
165 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org