comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWindow.java @ 826:2f65c742803f

Datacage: Aggregate items to load for easier filtering facets flys-client/trunk@2523 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 22 Aug 2011 14:29:49 +0000
parents ffb98b228b3c
children bd56dc762e7f
comparison
equal deleted inserted replaced
825:1b9b7e9ab219 826:2f65c742803f
43 import de.intevation.flys.client.shared.model.DataCageTree; 43 import de.intevation.flys.client.shared.model.DataCageTree;
44 import de.intevation.flys.client.shared.model.DataCageNode; 44 import de.intevation.flys.client.shared.model.DataCageNode;
45 import de.intevation.flys.client.shared.model.AttrList; 45 import de.intevation.flys.client.shared.model.AttrList;
46 46
47 import java.util.ArrayList; 47 import java.util.ArrayList;
48 import java.util.Map;
49 import java.util.HashMap;
48 import java.util.List; 50 import java.util.List;
49 import java.util.Stack; 51 import java.util.Stack;
50 52
51 public class DatacageWindow 53 public class DatacageWindow
52 extends Window 54 extends Window
64 protected TreeGrid treeGrid; 66 protected TreeGrid treeGrid;
65 protected Tree tree; 67 protected Tree tree;
66 68
67 protected Layout layout; 69 protected Layout layout;
68 70
69 protected List<ToLoad> toLoad; 71 protected Map<String, ToLoad> toLoad;
70 72
71 73
72 public DatacageWindow(Artifact artifact, User user) { 74 public DatacageWindow(Artifact artifact, User user) {
73 this.artifact = artifact; 75 this.artifact = artifact;
74 this.user = user; 76 this.user = user;
121 setShowModalMask(true); 123 setShowModalMask(true);
122 setCanDragResize(true); 124 setCanDragResize(true);
123 125
124 centerInPage(); 126 centerInPage();
125 127
126 toLoad = new ArrayList<ToLoad>(); 128 toLoad = new HashMap<String, ToLoad>();
127 129
128 triggerTreeBuilding(); 130 triggerTreeBuilding();
129 } 131 }
130 132
131 public List<ToLoad> toLoad() { 133 public Map<String, ToLoad> toLoad() {
132 return toLoad; 134 return toLoad;
133 } 135 }
134 136
135 public void plusClicked() { 137 public void plusClicked() {
136 if (treeGrid == null) { 138 if (treeGrid == null) {
173 if (factory != null) { // we need at least a factory 175 if (factory != null) { // we need at least a factory
174 String ids = node.getAttribute("ids"); 176 String ids = node.getAttribute("ids");
175 String artifactId = node.getAttribute("artifact-id"); 177 String artifactId = node.getAttribute("artifact-id");
176 String num = node.getAttribute("num"); 178 String num = node.getAttribute("num");
177 179
178 ToLoad tl = new ToLoad(factory, artifactId, ids, num); 180 ToLoad tl = toLoad.get(artifactId);
179 if (!toLoad.contains(tl)) { 181 if (tl == null) {
180 toLoad.add(tl); 182 tl = new ToLoad(artifactId);
181 } 183 }
184
185 tl.add(factory, ids, num);
182 } 186 }
183 TreeNode [] children = tree.getChildren(node); 187 TreeNode [] children = tree.getChildren(node);
184 if (children != null) { 188 if (children != null) {
185 for (TreeNode child: children) { 189 for (TreeNode child: children) {
186 stack.push(child); 190 stack.push(child);

http://dive4elements.wald.intevation.org