Mercurial > dive4elements > river
diff 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 |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWindow.java Mon Aug 22 13:29:55 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWindow.java Mon Aug 22 14:29:49 2011 +0000 @@ -45,6 +45,8 @@ import de.intevation.flys.client.shared.model.AttrList; import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; import java.util.List; import java.util.Stack; @@ -66,7 +68,7 @@ protected Layout layout; - protected List<ToLoad> toLoad; + protected Map<String, ToLoad> toLoad; public DatacageWindow(Artifact artifact, User user) { @@ -123,12 +125,12 @@ centerInPage(); - toLoad = new ArrayList<ToLoad>(); + toLoad = new HashMap<String, ToLoad>(); triggerTreeBuilding(); } - public List<ToLoad> toLoad() { + public Map<String, ToLoad> toLoad() { return toLoad; } @@ -175,10 +177,12 @@ String artifactId = node.getAttribute("artifact-id"); String num = node.getAttribute("num"); - ToLoad tl = new ToLoad(factory, artifactId, ids, num); - if (!toLoad.contains(tl)) { - toLoad.add(tl); + ToLoad tl = toLoad.get(artifactId); + if (tl == null) { + tl = new ToLoad(artifactId); } + + tl.add(factory, ids, num); } TreeNode [] children = tree.getChildren(node); if (children != null) {