comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java @ 1333:1627a28c4504

Cosmetics, docs. flys-client/trunk@2978 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 17 Oct 2011 09:41:40 +0000
parents cfbfaadf4b6f
children 46a4b74d87bf
comparison
equal deleted inserted replaced
1332:ab2b1a4a9ead 1333:1627a28c4504
150 this.differencesList.addData(pr); 150 this.differencesList.addData(pr);
151 } 151 }
152 } 152 }
153 153
154 154
155 /**
156 * Creates the graphical representation and interaction widgets for the data.
157 * @param dataList the data.
158 * @return graphical representation and interaction widgets for data.
159 */
155 @Override 160 @Override
156 public Canvas create(DataList dataList) { 161 public Canvas create(DataList dataList) {
157 GWT.log("createData()"); 162 GWT.log("createData()");
158 163
159 Canvas widget = createWidget(); 164 Canvas widget = createWidget();
252 257
253 return layout; 258 return layout;
254 } 259 }
255 260
256 261
262 /**
263 * Add record to list of removed records.
264 */
257 public void trackRemoved(Record r) { 265 public void trackRemoved(Record r) {
258 RecommendationPairRecord pr = (RecommendationPairRecord) r; 266 RecommendationPairRecord pr = (RecommendationPairRecord) r;
259 this.removedPairs.add(pr); 267 this.removedPairs.add(pr);
260 } 268 }
269
261 270
262 /** 271 /**
263 * Validates data, does nothing if invalid, otherwise clones new selected 272 * Validates data, does nothing if invalid, otherwise clones new selected
264 * waterlevels and add them to collection, forward the artifact. 273 * waterlevels and add them to collection, forward the artifact.
265 */ 274 */
276 Config config = Config.getInstance(); 285 Config config = Config.getInstance();
277 ListGridRecord[] records = differencesList.getRecords(); 286 ListGridRecord[] records = differencesList.getRecords();
278 287
279 List<Recommendation> ar = new ArrayList<Recommendation>(); 288 List<Recommendation> ar = new ArrayList<Recommendation>();
280 List<Recommendation> all = new ArrayList<Recommendation>(); 289 List<Recommendation> all = new ArrayList<Recommendation>();
290 List<Recommendation> statics = new ArrayList<Recommendation>();
281 for (ListGridRecord record : records) { 291 for (ListGridRecord record : records) {
282 RecommendationPairRecord r = 292 RecommendationPairRecord r =
283 (RecommendationPairRecord) record; 293 (RecommendationPairRecord) record;
284 // Do not add "old" recommendations. 294 // Do not add "old" recommendations.
285 if (!r.isAlreadyLoaded()) { 295 if (!r.isAlreadyLoaded()) {
296 // Check whether one of those is a dike or similar.
297 // TODO differentiate and merge: new clones, new, old.
298 if(r.getFirst().getIDs() != null
299 && r.getFirst().getIDs().startsWith("flood_protection"))
300 {
301 // These do not get cloned but loaded ("spawned").
302 }
286 ar.add(r.getFirst()); 303 ar.add(r.getFirst());
287 ar.add(r.getSecond()); 304 ar.add(r.getSecond());
288 } 305 }
289 else { 306 else {
290 all.add(r.getFirst()); 307 all.add(r.getFirst());
359 } ); 376 } );
360 } 377 }
361 378
362 379
363 /** 380 /**
364 * Create Data and DataItem from selection. 381 * Create Data and DataItem from selection (a long string with identifiers
382 * to construct diff-pairs).
383 *
384 * @param newRecommendations "new" recommendations (did not survive a
385 * backjump).
386 * @param newArtifacts artifacts cloned from newRecommendations.
387 * @param oldRecommendations old recommendations that survived a backjump.
388 *
389 * @return dataitem with a long string with identifiers to construct
390 * diff-pairs.
365 */ 391 */
366 protected Data[] getData( 392 protected Data[] getData(
367 Recommendation[] newRecommendations, 393 Recommendation[] newRecommendations,
368 Artifact[] newArtifacts, 394 Artifact[] newArtifacts,
369 Recommendation[] oldRecommendations) 395 Recommendation[] oldRecommendations)

http://dive4elements.wald.intevation.org