- Timestamp:
- 2009-11-22T18:26:54+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r2503 r2504 511 511 */ 512 512 private static class RelationListModel extends AbstractListModel { 513 /** the list of relations managaged by this model. Should never be null */ 514 private ArrayList<Relation> relations; 513 private final ArrayList<Relation> relations = new ArrayList<Relation>(); 515 514 private DefaultListSelectionModel selectionModel; 516 515 517 516 public RelationListModel(DefaultListSelectionModel selectionModel) { 518 517 this.selectionModel = selectionModel; 519 relations = new ArrayList<Relation>();520 518 } 521 519 … … 526 524 public synchronized void setRelations(Collection<Relation> relations) { 527 525 List<Relation> sel = getSelectedRelations(); 528 if (relations == null) { 529 this.relations.clear(); 530 } else { 531 this.relations = new ArrayList<Relation>(relations.size()); 532 for (Relation r: relations) { 533 if (! r.isDeleted() && r.isVisible() && !r.incomplete) { 534 this.relations.add(r); 535 } 526 this.relations.clear(); 527 for (Relation r: relations) { 528 if (! r.isDeleted() && r.isVisible() && !r.incomplete) { 529 this.relations.add(r); 536 530 } 537 531 } … … 564 558 if (addedPrimitives == null || addedPrimitives.isEmpty()) return; 565 559 boolean added = false; 566 if (relations == null) {567 relations = new ArrayList<Relation>();568 }569 560 for (OsmPrimitive p: addedPrimitives) { 570 561 if (! (p instanceof Relation)) {
Note:
See TracChangeset
for help on using the changeset viewer.