Changeset 5709 in josm
- Timestamp:
- 2013-02-12T21:41:26+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r5696 r5709 410 410 List<Relation> toDelete = new LinkedList<Relation>(); 411 411 for (int i : displaylist.getSelectedIndices()) { 412 toDelete.add(model.get Relation(i));412 toDelete.add(model.getVisibleRelation(i)); 413 413 } 414 414 for (Relation r : toDelete) { … … 519 519 ArrayList<OsmPrimitive> selection = new ArrayList<OsmPrimitive>(idx.length); 520 520 for (int i: idx) { 521 selection.add(model.get Relation(i));521 selection.add(model.getVisibleRelation(i)); 522 522 } 523 523 if(add) { … … 692 692 private ArrayList<Relation> filteredRelations; 693 693 private DefaultListSelectionModel selectionModel; 694 private SearchCompiler.Match filter;694 //private SearchCompiler.Match filter; 695 695 696 696 public RelationListModel(DefaultListSelectionModel selectionModel) { … … 785 785 int size = relations.size(); 786 786 relations.removeAll(removedRelations); 787 if (filteredRelations != null) { 788 filteredRelations.removeAll(removedRelations); 789 } 787 790 if (size != relations.size()) { 788 791 List<Relation> sel = getSelectedRelations(); … … 811 814 812 815 public void setFilter(final SearchCompiler.Match filter) { 813 this.filter = filter;816 //this.filter = filter; 814 817 this.filteredRelations = new ArrayList<Relation>(Utils.filter(relations, new Predicate<Relation>() { 815 818 @Override … … 827 830 return filteredRelations == null ? relations : filteredRelations; 828 831 } 832 833 private Relation getVisibleRelation(int index) { 834 if (index < 0 || index >= getVisibleRelations().size()) return null; 835 return getVisibleRelations().get(index); 836 } 829 837 830 838 @Override 831 839 public Object getElementAt(int index) { 832 if (index < 0 || index >= getVisibleRelations().size()) return null; 833 return getVisibleRelations().get(index); 840 return getVisibleRelation(index); 834 841 } 835 842 … … 879 886 * Sets the selected relations. 880 887 * 881 * @ returnsel the list of selected relations888 * @param sel the list of selected relations 882 889 */ 883 890 public void setSelectedRelations(Collection<Relation> sel) { … … 896 903 /** 897 904 * Returns the index of the relation 905 * @param rel The relation to look for 898 906 * 899 907 * @return index of relation (null if it cannot be found)
Note:
See TracChangeset
for help on using the changeset viewer.