Changeset 5147
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/clients/web/net/sf/basedb/clients/web/ExperimentExplorer.java
r5130 r5147 27 27 import java.util.ArrayList; 28 28 import java.util.Arrays; 29 import java.util.Collection; 29 30 import java.util.HashMap; 30 31 import java.util.HashSet; … … 194 195 The snapshot manager that loads annotation values. 195 196 */ 196 private finalSnapshotManager snapshotManager;197 private SnapshotManager snapshotManager; 197 198 198 199 /** … … 234 235 Caches annotation summaries. 235 236 */ 236 private Map< AnnotationType, AnnotationSummary> summaryCache;237 private Map<Integer, AnnotationSummary> summaryCache; 237 238 238 239 /** … … 244 245 this.bioAssays = new HashMap<Short, Integer>(); 245 246 this.snapshotManager = new SnapshotManager(); 246 this.summaryCache = new HashMap< AnnotationType, AnnotationSummary>();247 this.summaryCache = new HashMap<Integer, AnnotationSummary>(); 247 248 for (BioAssay ba : bioAssaySet.getBioAssays().list(bioAssaySet.getDbControl())) 248 249 { … … 412 413 @return The id of the selected annotation type or 0 if no annotation type 413 414 is selected 414 @deprecated Use {@link #getAnnotationTypeIds()} instead415 @deprecated In 2.14, use {@link #getAnnotationTypeIds()} instead 415 416 */ 416 417 public int getAnnotationTypeId() … … 425 426 @param annotationTypeId The annotation type id or 0 if none is 426 427 selected 427 @deprecated Use {@link #getAnnotationTypeIds()} instead428 @deprecated In 2.14, use {@link #setAnnotationTypeIds(Collection)} instead 428 429 */ 429 430 public void setAnnotationTypeId(int annotationTypeId) … … 435 436 436 437 /** 437 Get a set for keeping track of the selected annotation types. 438 @return A set for storing integers (=the id of the selected annotation types) 438 Get the selected annotation types. 439 @return A set with the the id's of the selected annotation types 440 @since 2.14 439 441 */ 440 442 public Set<Integer> getAnnotationTypeIds() … … 442 444 if (annotationTypeIds == null) annotationTypeIds = new HashSet<Integer>(); 443 445 return annotationTypeIds; 446 } 447 448 /** 449 Update the selected annotation types. 450 @param ids A collection containing the id's of all annotation types 451 that should currently be selected, all other annotation types are 452 automatically deselected 453 @since 2.14 454 */ 455 public void setAnnotationTypeIds(Collection<Integer> ids) 456 { 457 Set<Integer> current = getAnnotationTypeIds(); 458 current.clear(); 459 for (Integer id : ids) 460 { 461 current.add(id); 462 summaryCache.remove(id); 463 } 464 // The snapshot manager also has an in-memory cache 465 snapshotManager = new SnapshotManager(); 444 466 } 445 467 … … 500 522 public AnnotationSummary getAnnotationSummary(DbControl dc, AnnotationType annotationType) 501 523 { 502 AnnotationSummary summary = summaryCache.get(annotationType );524 AnnotationSummary summary = summaryCache.get(annotationType.getId()); 503 525 if (summary == null) 504 526 { 505 527 summary = new AnnotationSummary(this, dc, annotationType); 506 summaryCache.put(annotationType , summary);528 summaryCache.put(annotationType.getId(), summary); 507 529 } 508 530 else -
trunk/www/views/experiments/explorer/view/index.jsp
r5137 r5147 86 86 { 87 87 Integer[] annotationTypes = Values.getInt(request.getParameter("annotationtype_id").split("\\|")); 88 Set<Integer> tmp = explorer.getAnnotationTypeIds(); 89 tmp.clear(); 90 tmp.addAll(Arrays.asList(annotationTypes)); 88 explorer.setAnnotationTypeIds(Arrays.asList(annotationTypes)); 91 89 92 90 // If an annotation type is selected the annotation column must be visible as the first column
Note: See TracChangeset
for help on using the changeset viewer.