Mercurial > dive4elements > river
comparison 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 |
comparison
equal
deleted
inserted
replaced
1351:19f621663b7a | 1352:01b18db3b288 |
---|---|
123 (); | 123 (); |
124 facets.add(facet); | 124 facets.add(facet); |
125 filter.add("longitudinal_section", facets); | 125 filter.add("longitudinal_section", facets); |
126 Recommendation r = new Recommendation("waterlevel", parts[0], | 126 Recommendation r = new Recommendation("waterlevel", parts[0], |
127 this.artifact.getUuid(), filter); | 127 this.artifact.getUuid(), filter); |
128 r.setDisplayName(parts[3]); | |
128 return r; | 129 return r; |
129 } | 130 } |
130 | 131 |
131 | 132 |
132 /** | 133 /** |
141 for (int i = 0; i < recs.length; i+=2) { | 142 for (int i = 0; i < recs.length; i+=2) { |
142 Recommendation minuend = | 143 Recommendation minuend = |
143 createRecommendationFromString(recs[i+0]); | 144 createRecommendationFromString(recs[i+0]); |
144 Recommendation subtrahend = | 145 Recommendation subtrahend = |
145 createRecommendationFromString(recs[i+1]); | 146 createRecommendationFromString(recs[i+1]); |
147 //minuend.setDisplayName("hum"); subtrahend.setDisplayName("wim"); | |
146 RecommendationPairRecord pr = new RecommendationPairRecord( | 148 RecommendationPairRecord pr = new RecommendationPairRecord( |
147 "A", minuend, "B", subtrahend); | 149 minuend, subtrahend); |
148 // This Recommendation Pair comes from the data string and was thus | 150 // This Recommendation Pair comes from the data string and was thus |
149 // already cloned. | 151 // already cloned. |
150 pr.setIsAlreadyLoaded(true); | 152 pr.setIsAlreadyLoaded(true); |
151 this.differencesList.addData(pr); | 153 this.differencesList.addData(pr); |
152 } | 154 } |
387 | 389 |
388 // Clone new ones (and spawn statics), go forward. | 390 // Clone new ones (and spawn statics), go forward. |
389 loadArtifactService.loadMany( | 391 loadArtifactService.loadMany( |
390 this.collection, | 392 this.collection, |
391 toClone, | 393 toClone, |
392 //"staticwkms", | 394 //"staticwkms" and "waterlevel" |
393 null, | 395 null, |
394 url, | 396 url, |
395 locale, | 397 locale, |
396 new AsyncCallback<Artifact[]>() { | 398 new AsyncCallback<Artifact[]>() { |
397 public void onFailure(Throwable caught) { | 399 public void onFailure(Throwable caught) { |
432 Artifact newArtifact = newArtifacts[i]; | 434 Artifact newArtifact = newArtifacts[i]; |
433 String uuid = newArtifact.getUuid(); | 435 String uuid = newArtifact.getUuid(); |
434 r.setMasterArtifact(uuid); | 436 r.setMasterArtifact(uuid); |
435 if (i>0) dataItemString += "#"; | 437 if (i>0) dataItemString += "#"; |
436 | 438 |
437 dataItemString += createDataString(uuid, r.getFilter()); | 439 dataItemString += createDataString(uuid, r); |
438 } | 440 } |
439 | 441 |
440 for (int i = 0; i < oldRecommendations.length; i++) { | 442 for (int i = 0; i < oldRecommendations.length; i++) { |
441 Recommendation r = oldRecommendations[i]; | 443 Recommendation r = oldRecommendations[i]; |
442 String uuid = r.getIDs(); | 444 String uuid = r.getIDs(); |
443 if (dataItemString.length() > 0) dataItemString += "#"; | 445 if (dataItemString.length() > 0) dataItemString += "#"; |
444 | 446 |
445 dataItemString += createDataString(uuid, r.getFilter()); | 447 dataItemString += createDataString(uuid, r); |
446 } | 448 } |
447 | 449 |
450 // TODO some hassle could be resolved by using multiple DataItems | |
451 // (e.g. one per pair). | |
448 DataItem item = new DefaultDataItem(dataName, dataName, dataItemString); | 452 DataItem item = new DefaultDataItem(dataName, dataName, dataItemString); |
449 return new Data[] { new DefaultData( | 453 return new Data[] { new DefaultData( |
450 dataName, null, null, new DataItem[] {item}) }; | 454 dataName, null, null, new DataItem[] {item}) }; |
451 } | 455 } |
452 | 456 |
453 | 457 |
454 /** | 458 /** |
455 * Creates part of the String that encodes minuend or subtrahend. | 459 * Creates part of the String that encodes minuend or subtrahend. |
456 */ | 460 */ |
457 protected String createDataString(String artifact, Filter filter) { | 461 protected String createDataString( |
458 Facet f = null; | 462 String artifact, |
463 Recommendation recommendation) | |
464 { | |
465 Filter filter = recommendation.getFilter(); | |
466 Facet f = null; | |
459 | 467 |
460 if(filter != null) { | 468 if(filter != null) { |
461 Map<String, List<Facet>> outs = filter.getOuts(); | 469 Map<String, List<Facet>> outs = filter.getOuts(); |
462 Set<Map.Entry<String, List<Facet>>> entries = outs.entrySet(); | 470 Set<Map.Entry<String, List<Facet>>> entries = outs.entrySet(); |
463 | 471 |
468 if (f != null) { | 476 if (f != null) { |
469 break; | 477 break; |
470 } | 478 } |
471 } | 479 } |
472 | 480 |
473 return "[" + artifact + ";" + f.getName() + ";" + f.getIndex() + "]"; | 481 // Hell get the creepy name inside. |
482 return "[" + artifact + ";" + f.getName() + ";" + f.getIndex() + ";" + recommendation.getDisplayName() + "]"; | |
474 } | 483 } |
475 else { | 484 else { |
476 return "[" + artifact + ";staticwkms;0]"; | 485 return "[" + artifact + ";staticwkms;0;" + recommendation.getDisplayName() + "]"; |
477 } | 486 } |
478 | |
479 | |
480 } | 487 } |
481 } | 488 } |
482 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 489 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |