comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DatacageTwinPanel.java @ 6591:661faf99d240

issue1394: Minor refactoring.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 18 Jul 2013 12:33:06 +0200
parents 967ae6799d98
children 67b4728723df
comparison
equal deleted inserted replaced
6590:266864819f0b 6591:661faf99d240
275 public void trackRemoved(Record r) { 275 public void trackRemoved(Record r) {
276 RecommendationPairRecord pr = (RecommendationPairRecord) r; 276 RecommendationPairRecord pr = (RecommendationPairRecord) r;
277 this.removedPairs.add(pr); 277 this.removedPairs.add(pr);
278 } 278 }
279 279
280 /**
281 * Set factory of recommendation such that the correct artifacts will
282 * be cloned for difference calculations.
283 */
280 public void adjustRecommendation(Recommendation recommendation) { 284 public void adjustRecommendation(Recommendation recommendation) {
281 if (recommendation.getIDs() != null) { 285 if (recommendation.getIDs() != null) {
282 GWT.log("Setting staticwkms factory for rec with ID " 286 GWT.log("Setting staticwkms factory for rec with ID "
283 + recommendation.getIDs()); 287 + recommendation.getIDs());
284 recommendation.setFactory("staticwkms"); 288 recommendation.setFactory("staticwkms");
321 // Do not add "old" recommendations. 325 // Do not add "old" recommendations.
322 if (!r.isAlreadyLoaded()) { 326 if (!r.isAlreadyLoaded()) {
323 // Check whether one of those is a dike or similar. 327 // Check whether one of those is a dike or similar.
324 // TODO differentiate and merge: new clones, new, old. 328 // TODO differentiate and merge: new clones, new, old.
325 Recommendation firstR = r.getFirst(); 329 Recommendation firstR = r.getFirst();
326 if(firstR.getIDs() != null) { 330 adjustRecommendation(firstR);
327 GWT.log("First IDs: " + firstR.getIDs() + " factory: " 331
328 + firstR.getFactory());
329 }
330 if(firstR.getIDs() != null) {
331 // These do not get cloned but loaded ("spawned").
332 firstR.setFactory("staticwkms");
333 }
334 else {
335 firstR.setFactory("waterlevel");
336 }
337 Recommendation secondR = r.getSecond(); 332 Recommendation secondR = r.getSecond();
338 if(secondR.getIDs() != null) { 333 adjustRecommendation(secondR);
339 GWT.log("Second IDs: " + secondR.getIDs() + " factory: "
340 + secondR.getFactory());
341 }
342 if (secondR.getIDs() != null) {
343 // These do not get cloned but loaded ("spawned").
344 secondR.setFactory("staticwkms");
345 }
346 else {
347 secondR.setFactory("waterlevel");
348 }
349 334
350 ar.add(firstR); 335 ar.add(firstR);
351 ar.add(secondR); 336 ar.add(secondR);
352 } 337 }
353 else { 338 else {

http://dive4elements.wald.intevation.org