Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java @ 1352:01b18db3b288
In WDiff datacage input make names survive backjumps.
flys-client/trunk@3027 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 19 Oct 2011 11:08:03 +0000 |
parents | 46a4b74d87bf |
children | 9da7fdfbb80e |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java Wed Oct 19 09:35:41 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java Wed Oct 19 11:08:03 2011 +0000 @@ -125,6 +125,7 @@ filter.add("longitudinal_section", facets); Recommendation r = new Recommendation("waterlevel", parts[0], this.artifact.getUuid(), filter); + r.setDisplayName(parts[3]); return r; } @@ -143,8 +144,9 @@ createRecommendationFromString(recs[i+0]); Recommendation subtrahend = createRecommendationFromString(recs[i+1]); + //minuend.setDisplayName("hum"); subtrahend.setDisplayName("wim"); RecommendationPairRecord pr = new RecommendationPairRecord( - "A", minuend, "B", subtrahend); + minuend, subtrahend); // This Recommendation Pair comes from the data string and was thus // already cloned. pr.setIsAlreadyLoaded(true); @@ -389,7 +391,7 @@ loadArtifactService.loadMany( this.collection, toClone, - //"staticwkms", + //"staticwkms" and "waterlevel" null, url, locale, @@ -434,7 +436,7 @@ r.setMasterArtifact(uuid); if (i>0) dataItemString += "#"; - dataItemString += createDataString(uuid, r.getFilter()); + dataItemString += createDataString(uuid, r); } for (int i = 0; i < oldRecommendations.length; i++) { @@ -442,9 +444,11 @@ String uuid = r.getIDs(); if (dataItemString.length() > 0) dataItemString += "#"; - dataItemString += createDataString(uuid, r.getFilter()); + dataItemString += createDataString(uuid, r); } + // TODO some hassle could be resolved by using multiple DataItems + // (e.g. one per pair). DataItem item = new DefaultDataItem(dataName, dataName, dataItemString); return new Data[] { new DefaultData( dataName, null, null, new DataItem[] {item}) }; @@ -454,8 +458,12 @@ /** * Creates part of the String that encodes minuend or subtrahend. */ - protected String createDataString(String artifact, Filter filter) { - Facet f = null; + protected String createDataString( + String artifact, + Recommendation recommendation) + { + Filter filter = recommendation.getFilter(); + Facet f = null; if(filter != null) { Map<String, List<Facet>> outs = filter.getOuts(); @@ -470,13 +478,12 @@ } } - return "[" + artifact + ";" + f.getName() + ";" + f.getIndex() + "]"; + // Hell get the creepy name inside. + return "[" + artifact + ";" + f.getName() + ";" + f.getIndex() + ";" + recommendation.getDisplayName() + "]"; } else { - return "[" + artifact + ";staticwkms;0]"; + return "[" + artifact + ";staticwkms;0;" + recommendation.getDisplayName() + "]"; } - - } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :